Skip to content

Instantly share code, notes, and snippets.

@tarang9211
Created October 23, 2019 08:10
Show Gist options
  • Save tarang9211/4fa3955ef1152e6b1b87caefc423a224 to your computer and use it in GitHub Desktop.
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