Last active
March 21, 2018 15:28
-
-
Save nikolasburk/a9ec1177143e898f43bfe2d5cdbfdf75 to your computer and use it in GitHub Desktop.
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: { | |
user: (root, args) => db.getUser(argd.id), | |
users: () => db.getUsers(), | |
}, | |
Mutation: { | |
createUser: (root, args) => db.createUser(args.name), | |
updateUser: (root, args) => db.updateUser(args.id, args.name), | |
deleteUser: (root, args) => db.deleteUser(args.id), | |
}, | |
User: { | |
id: (root) => root.id, | |
name: (root) => root.name | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment