Created
April 11, 2018 12:31
-
-
Save wojciech-bilicki/b9b67bd45e6f5b667e1433ae8cfb7e95 to your computer and use it in GitHub Desktop.
Resolver with select
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
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