GraphQL query colides with Dgraph's predicate (bug with pre-existing data)

It’s a little hard to see what’s going on here. So I’m going to make some assumptions.

Looks like you have some existing data with things of type User that have a name predicate. Then I’m guessing that you’ve added a GraphQL schema like

type User {
   username: String!
   name: String
} 

so what happens is that GraphQL maps those to the predicates User.username and User.name. Note though that you’ve said that username should never be null. So when you query for

query {
  queryUser {
    username
  }
}

You’ll find all the existing users by type … but they don’t have User.username predicate, so GraphQL tells you that it found some users that were in an error state. So those errors make sense.

If you want to change how the GraphQL schema maps down to an existing Dgraph schema, then you need these instructions and do something like

type User {
   ...
   name: String @dgraph(pred: "name")
} 

Let me know if my assumptions were wrong there.