Skip to content

Instantly share code, notes, and snippets.

@redbluenat
Created December 20, 2018 18:43
Show Gist options
  • Save redbluenat/7d1c5fac2f7e7f84a32bce0979a128da to your computer and use it in GitHub Desktop.
Save redbluenat/7d1c5fac2f7e7f84a32bce0979a128da to your computer and use it in GitHub Desktop.
index.js
const Mutation = require('./Mutations');
const resolvers = {
Query: {
dogName: () => `Tommy the chihuahua`,
dogs: (root, args, context, queryInfo) => {
return context.db.query.dogs({}, queryInfo);
},
user: (root, args, context, info) => {
return context.db.query.user({ where: { id: root.user.id } }, info);
}
},
Mutation
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment