Weird error. If I paste my schema into Dgraph Cloud and deploy it I get the following error:
resolving updateGQLSchema failed because Type User: @auth: failed to validate GraphQL rule [reason : Field "eq" is not defined by type ID.]
The User type from my schema:
type User @auth(
query: { or: [
{ rule: """
query($EMAIL: String!) {
queryUser(filter: {
email: {
eq: $EMAIL
}
}) {
id
}
}
"""
}
{ rule: """
query($USERID: String!) {
queryUser(filter: {
id: {
eq: $USERID
}
}) {
id
}
}
"""
}
{ rule: "{$ROLE: { eq: \"ADMIN\" } }" }
]}
add: { or: [
{ rule: "{ $ROLE: { eq: \"ADMIN\" } }" }
{ rule: """
query($EMAIL: String!) {
queryUser(filter: {
email: {
eq: $EMAIL
}
}) {
id
}
}
"""
}
]},
) {
id: ID!
email: String! @id
username: String
stripeCustomerId: String
}
EDIT: So I verified that it has a problem with this specific rule:
{ rule: """
query($USERID: String!) {
queryUser(filter: {
id: {
eq: $USERID
}
}) {
id
}
}
"""
}