Skip to content

Instantly share code, notes, and snippets.

@Cal30
Created January 19, 2017 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cal30/c3f1f549f7355024f39f033b51cf73b1 to your computer and use it in GitHub Desktop.
Save Cal30/c3f1f549f7355024f39f033b51cf73b1 to your computer and use it in GitHub Desktop.
GraphQL Post - Query Object
return newObject()
.name("Query")
.description("Root query")
.field(newFieldDefinition()
.name("film")
.description("Find a film by id")
.argument(newArgument() // argumento (id: ID)
.name("id")
.description("Film ID")
.type(new GraphQLNonNull(GraphQLInt)))
.type(new GraphQLTypeReference("Film"))
.dataFetcher(filmDataFetcher))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment