Created
March 12, 2018 22:03
-
-
Save lastmjs/5392b73d729c70a231c1bbaa57863a7e to your computer and use it in GitHub Desktop.
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
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