diff options
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/src/resolvers/Query.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/src/resolvers/Query.js b/backend/src/resolvers/Query.js index a34b484..22dcd2a 100644 --- a/backend/src/resolvers/Query.js +++ b/backend/src/resolvers/Query.js @@ -24,8 +24,10 @@ const Query = { }, async orders(parent, args, ctx, info) { - const userId = getUserId(ctx); - console.log(info); + const { userId } = ctx.request; + if (!userId) { + throw new Error('You must be signed in to see your orders'); + } return ctx.db.query.orders( { where: { |
