Skip to content

Instantly share code, notes, and snippets.

@lastmjs
Created March 12, 2018 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lastmjs/5392b73d729c70a231c1bbaa57863a7e to your computer and use it in GitHub Desktop.
Save lastmjs/5392b73d729c70a231c1bbaa57863a7e to your computer and use it in GitHub Desktop.
export async function authenticatedDirectiveResolver(next, source, args, context) {
if (getUserId(context)) {
return await next();
}
else {
throw new Error('Not authenticated');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment