Created
October 3, 2017 20:12
-
-
Save Bensigo/e052383bc7fd0b8ec1a76ad087ecd48c 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
module.exports = { | |
Query: { | |
hello (root, args, context) { | |
return 'Hello World!!' | |
} | |
}, | |
Mutation: { | |
async createUser (root, args, {DB}) { | |
const {username, email, password} = args | |
const user = await DB.User.createUser(email, username, password) | |
return user | |
}, | |
async login (root, args, {DB}) { | |
const {email, password} = args | |
const user = await DB.User.auth(email, password) | |
return user | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment