diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-04-06 16:44:50 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-04-06 16:44:50 -0400 |
| commit | d22616d5a675f5a381c741784333151255713b45 (patch) | |
| tree | 51dc4a138fc4b1e8ac1b1e287e5c246f24377242 /backend/src | |
| parent | d90d97337c39e1fa723ee01627fbd3f78adfcf31 (diff) | |
local data with apollo
Diffstat (limited to 'backend/src')
| -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: { |
