Skip to content

Instantly share code, notes, and snippets.

@Bensigo
Created October 3, 2017 20:12
Show Gist options
  • Save Bensigo/e052383bc7fd0b8ec1a76ad087ecd48c to your computer and use it in GitHub Desktop.
Save Bensigo/e052383bc7fd0b8ec1a76ad087ecd48c to your computer and use it in GitHub Desktop.
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