Last active
January 21, 2019 12:56
-
-
Save marekpiechut/6e53750967fa094ad83cfa93079e8e12 to your computer and use it in GitHub Desktop.
Authentication and Authorization in NodeJS GraphQL API
This file contains hidden or 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
| Query: { | |
| templates: (parent, args, { user }) => { | |
| if (user && user.role === 'MEMBER') { | |
| return service.fetchForUser(user.uuid) | |
| } else { | |
| throw new AuthenticationError('No Access!') | |
| } | |
| }, | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment