graphql.github.io
graphql.github.io copied to clipboard
Server GraphQL structure does not match the Query
Currently learning GraphQL and noticed an inconsistency in between:
type Query {
hero: Character
droid(id: ID!): Droid
}
and
query {
hero {
name
}
droid(id: "2000") {
name
}
}
Closes #
Description
- :x: - Rudi Boshoff The commit (365120ff38e3ecc049971529f844c9fc537dfaf9) is not authorized under a signed CLA. Please click here to be authorized. For further assistance with EasyCLA, please submit a support request ticket.
Hi @RudiBoshoff thanks for contributing! There’s actually no error here since the argument for the field hero(episode: Episode): Character is optional (it has no !) you can query it without arguments (which you must do without parentheses).
closing per @benjie 's comment