Skip to content

Instantly share code, notes, and snippets.

@wojciech-bilicki
Created April 11, 2018 12:31
Show Gist options
  • Save wojciech-bilicki/b9b67bd45e6f5b667e1433ae8cfb7e95 to your computer and use it in GitHub Desktop.
Save wojciech-bilicki/b9b67bd45e6f5b667e1433ae8cfb7e95 to your computer and use it in GitHub Desktop.
Resolver with select
const resolvers = {
Query: {
authors: () => {
return authors
},
author: (root, args) => {
const age = args.age;
return authors.find(author => author.age === age);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment