From a09b01abf7c03e6b7e43f2175e5a34501808821b Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Tue, 13 Feb 2018 17:04:00 -0500 Subject: omg it works --- backend/src/resolvers/Query.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'backend/src/resolvers/Query.js') diff --git a/backend/src/resolvers/Query.js b/backend/src/resolvers/Query.js index 8649e43..2aabdb7 100644 --- a/backend/src/resolvers/Query.js +++ b/backend/src/resolvers/Query.js @@ -41,10 +41,15 @@ const Query = { return ctx.db.query.user({ where: { id } }, info); }, async orders(parent, args, ctx, info) { - console.l('--------------------FETCHING ORDERS---------------------'); - console.log(args); - return ctx.db.query.orders({}, info); - console.l('--------------------FETCHING ORDERS---------------------'); + const userId = getUserId(ctx); + return ctx.db.query.orders( + { + where: { + user: { id: userId }, + }, + }, + info + ); }, }; -- cgit v1.3