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

Yes. I had used Dgraph’s Type Def previously and the dataset has <dgraph.type> "User", in the case used

#PS. This is a Dgraph Type. Not GraphQL.
type User {
   name
   (...and other preds)
}

Seems like the GraphQL overwrites it.

The schema is exactly this one graphql-sample-apps/todo-app-react/schema.graphql at master · dgraph-io/graphql-sample-apps · GitHub

The assumptions are close to right, but the solution isn’t good enough. But might work in other cases.

This solution solves part of the issue, but it “reverts” the query. Now I can see all previous users, except the one made specifically to the Todo example in the repo. In this case, “Alice” is null now.

The issue here is that seems like Dgraph can’t handle well, two models at the same time. The GraphQL way and Dgraph way. The mapping you have shown is really nice to someone who wanna use GraphQL without converting their predicate naming to <User.name> .... They can just map it. But I would prefer that the result of this context would ignore my previous data, maybe using “cascade”. Assuming that the query:

query {
  queryUser {
    ...
  }
}

does internally a DQL query like this

{
  q(func: type(User)) {
    User.name
  }
}

In fact this query above returns only the desired node. I can return all the other ones if I use “has” instead of ‘type()’. Which is odd, the GraphQL query should return only Alice as Dgraph does using DQL, not the 9 other users. If I add “name” to that last query, I can see all of them.

So, what the GraphQL does under the hood? a has func?