Reserved word `as` for GraphQL schema

Schema:

type Verification {
  id: ID!
  isValid: Boolean
  as: String
  ...
}
...

My query:

{
  queryVerification {
    isValid
    as
  }
}

Returns error:

Dgraph query failed because Dgraph execution failed because Some variables are defined but not used\nDefined:[Verification.isValid]\nUsed:[]\n

I understand why this is now because as is used for variables in Dgraph (GraphQL±) So, this needs to be noted somewhere if it is not already as a reserved keyword and the schema update script should emit an error if this is used for a field name

Using version 2.0.0-rc1-448-gd5892d if it makes a difference

Thanks. I think we should call ‘as’ a reserved word and disallow.

I’ve added this, so we can track it.

1 Like