Skip to content

Instantly share code, notes, and snippets.

@tarang9211
Created October 23, 2019 08:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tarang9211/4fa3955ef1152e6b1b87caefc423a224 to your computer and use it in GitHub Desktop.
apollo-auth
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