summaryrefslogtreecommitdiffstats
path: root/backend/src/resolvers/Query.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-02-13 17:04:00 -0500
committerWes Bos <wesbos@gmail.com>2018-02-13 17:04:00 -0500
commita09b01abf7c03e6b7e43f2175e5a34501808821b (patch)
tree21ae6feb1d9ac1a07f045dffc24db406e2a4183b /backend/src/resolvers/Query.js
parentfa3ec3299b3fa33e5a699683beb96cfa4e6dd51d (diff)
omg it works
Diffstat (limited to 'backend/src/resolvers/Query.js')
-rw-r--r--backend/src/resolvers/Query.js13
1 files changed, 9 insertions, 4 deletions
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
+ );
},
};