Created
January 19, 2017 17:10
-
-
Save Cal30/c3f1f549f7355024f39f033b51cf73b1 to your computer and use it in GitHub Desktop.
GraphQL Post - Query Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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