I’m not sure if this is intentional, but when the query part does not allow the retrieval of an object, graphql errors are being masked.
Schema:
type Foo @auth(
query: { rule: "{$DENIED: { eq: \"DENIED\" } }" }
) {
username: String! @id
}
Steps to reproduce:
- Add Foo
mutation {
addFoo(input: [
{
username: "user"
}
]) {
numUids
}
}
- Redo mutation with same username:
mutation {
addFoo(input: [
{
username: "user"
}
]) {
numUids
}
}
Notice how the returned data from dgraph ist just null
instead of returning an error that a Foo
with username==user
already exists.