Hi, I use dgraph2.0 with graphql, and I had read about graphql doc
In my pratice, I have a problem of querying that use other type as filter.
For example, I have a schema like this:
type User {
name: String! @id
role: Role
}
type Role {
name: String! @id
permission: String!
}
I have some kind of role, like “admin”, “editor”, “visitor”…
Every user have a special role.
So how can I find all user that have a role named “admin”?
I mad a query like this:
query{
queryUser(filter:{role:{name:{eq:"admin"}}}) {
name
}
}
but it returns an error for me: “message”: “Field “role” is not defined by type UserFilter.”
So I use another query like this:
query {
queryUser() {
name
role(filter:{name:{eq:"admin"}}) {
name
}
}
}
But it returns all user for me and some of the use’s role is null, I don’t know how to make query with graphql in this case I just want to get the user that have a role named “admin”… not all of the user