From fa3ec3299b3fa33e5a699683beb96cfa4e6dd51d Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Tue, 13 Feb 2018 13:19:23 -0500 Subject: getting there --- backend/src/resolvers/Query.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'backend/src/resolvers/Query.js') diff --git a/backend/src/resolvers/Query.js b/backend/src/resolvers/Query.js index e6ea299..8649e43 100644 --- a/backend/src/resolvers/Query.js +++ b/backend/src/resolvers/Query.js @@ -31,6 +31,7 @@ const Query = { }, me(parent, args, ctx, info) { + console.l('me!'); const Authorization = ctx.request.get('Authorization'); if (!Authorization || Authorization === 'null') { console.log('Authorization is null'); @@ -39,6 +40,12 @@ const Query = { const id = getUserId(ctx); 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---------------------'); + }, }; module.exports = Query; -- cgit v1.3