Created
October 23, 2019 08:10
-
-
Save tarang9211/4fa3955ef1152e6b1b87caefc423a224 to your computer and use it in GitHub Desktop.
apollo-auth
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
Mutation: { | |
login: (parent, args, context, info) => { | |
const { email } = args; | |
const user = getUserByEmail(email); | |
console.log(context); | |
if (user) { | |
context.req = { | |
...context.req, | |
session: user | |
} | |
return user; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment