From d22616d5a675f5a381c741784333151255713b45 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 6 Apr 2018 16:44:50 -0400 Subject: local data with apollo --- backend/src/resolvers/Query.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'backend/src') 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: { -- cgit v1.3