Created
March 16, 2020 18:38
-
-
Save kluu1/e2de1f7681056cecae950a9402da68ed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import lodash from 'lodash/collection'; | |
| const users = [ | |
| { id: 1, name: 'barney', age: 36, active: true }, | |
| { id: 2, name: 'fred', age: 40, active: false }, | |
| { id: 3, name: 'pebbles', age: 1, active: true } | |
| ]; | |
| const resolvers = { | |
| Query: { | |
| getUser: (_, { id }) => { | |
| return lodash.find(users, { id }); | |
| } | |
| } | |
| }; | |
| export default resolvers; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment