Autogenerated get__ query still don't work after v20.07.0

I tried again to use the autogenerated get__ query in the GraphQL schema and it seems to be still unavailable.

schema:

interface Metadata {
  id: String! @id @search(by: [hash])
  createdAt: DateTime!
  modifiedAt: DateTime!
  generation: Int!
  version: Int!
}

type Text implements Metadata {
  string: String! @search(by: [trigram, term, fulltext])
}
query {
  queryText(first:1) {
    id
  }
}

returns:

  "data": {
    "queryText": [
      {
        "id": "ASTXT-999c1925220f8b91ee738e6c6238c300d4108c860713163c70cf0343aebb298e"
      }
    ]
  },

but

query {
  getText(id:"ASTXT-999c1925220f8b91ee738e6c6238c300d4108c860713163c70cf0343aebb298e") {
    id
  }
}

throws an error

"errors": [
    {
      "message": "Dgraph query failed because Dgraph execution failed because line 2 column 19: Invalid use of comma."
    }
  ],
  "data": {
    "getText": null
  },

Hey @Luscha

This was a bug that was there when you used a field with @id directive called id. We have fixed this in master and it would be part of the next patch release v20.07.1. In the meantime, you can use the Dgraph image from master or update the name of the field to something else like

interface Metadata {
  metaID: String! @id 
}
...
...

See queryTweets works, but getTweets does not work for more details about the bug.

2 Likes