Skip to content

Instantly share code, notes, and snippets.

@kluu1
Created March 16, 2020 18:38
Show Gist options
  • Select an option

  • Save kluu1/e2de1f7681056cecae950a9402da68ed to your computer and use it in GitHub Desktop.

Select an option

Save kluu1/e2de1f7681056cecae950a9402da68ed to your computer and use it in GitHub Desktop.
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