diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-08-14 15:39:34 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-08-14 15:39:34 -0400 |
| commit | ee09df7dee16a7b44711159c60c54cc9365be35e (patch) | |
| tree | f44bfca6d65c0082ca267300c33ff8186a713ec0 /finished-application/backend/src/resolvers | |
| parent | a07aad867cdfc3d5f270be25e571901af500f625 (diff) | |
stepped
Diffstat (limited to 'finished-application/backend/src/resolvers')
| -rw-r--r-- | finished-application/backend/src/resolvers/Query.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/finished-application/backend/src/resolvers/Query.js b/finished-application/backend/src/resolvers/Query.js index 51c2c42..a51ead5 100644 --- a/finished-application/backend/src/resolvers/Query.js +++ b/finished-application/backend/src/resolvers/Query.js @@ -5,6 +5,13 @@ const { forwardTo } = require('prisma-binding'); const Query = { items: forwardTo('db'), itemsConnection: forwardTo('db'), + async users(parent, args, ctx, info) { + if (!ctx.request.userId) { + throw new Error('Insufficient Permissions'); + } + + return ctx.db.query.users({}, info); + }, async order(parent, args, ctx, info) { // 1. make sure they are signed in |
