Skip to content

Instantly share code, notes, and snippets.

@zegnus
Created December 24, 2018 15:09
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 zegnus/7bdcf3188887aa15078d179373f591e3 to your computer and use it in GitHub Desktop.
Save zegnus/7bdcf3188887aa15078d179373f591e3 to your computer and use it in GitHub Desktop.
RootQuery = new GraphQLObjectType({
name: 'RootQueryType',
fields: {
book: {
type: BookType,
args: { id: { type: GraphQLString } },
resolve(parent, args) {
// find data
return lodash.find(books, {id: args.id})
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment