summaryrefslogtreecommitdiffstats
path: root/backend/src/resolvers/Query.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-03-20 21:52:36 -0400
committerWes Bos <wesbos@gmail.com>2018-03-20 21:52:36 -0400
commit93495ce146c4e81ecfab3a0bca99460e75a759da (patch)
tree12b2de283a017ff6cc53c1175371f9add84238d2 /backend/src/resolvers/Query.js
parent92f612a995c54f7423bd2b760fb1a324044693a6 (diff)
tests
Diffstat (limited to 'backend/src/resolvers/Query.js')
-rw-r--r--backend/src/resolvers/Query.js25
1 files changed, 3 insertions, 22 deletions
diff --git a/backend/src/resolvers/Query.js b/backend/src/resolvers/Query.js
index 262517a..2aa4f5c 100644
--- a/backend/src/resolvers/Query.js
+++ b/backend/src/resolvers/Query.js
@@ -8,31 +8,11 @@ const Query = {
},
itemsConnection: forwardTo('db'),
- order: forwardTo('db'),
-
- // feed(parent, args, ctx, info) {
- // return ctx.db.query.posts({}, info);
- // },
-
- // drafts(parent, args, ctx, info) {
- // // const id = getUserId(ctx);
-
- // const where = {
- // isPublished: false,
- // // author: {
- // // id,
- // // },
- // };
- // return ctx.db.query.posts({ where }, info);
- // },
-
- // post(parent, { id }, ctx, info) {
- // return ctx.db.query.post({ where: { id } }, info);
- // },
+ // TODO: Make sure they own this order before looking it up
+ order: forwardTo('db'),
me(parent, args, ctx, info) {
- console.l('me!');
const Authorization = ctx.request.get('Authorization');
if (!Authorization || Authorization === 'null') {
console.log('Authorization is null');
@@ -41,6 +21,7 @@ const Query = {
const id = getUserId(ctx);
return ctx.db.query.user({ where: { id } }, info);
},
+
async orders(parent, args, ctx, info) {
const userId = getUserId(ctx);
return ctx.db.query.orders(