From 65c524251d49ade9d44a62337f3c1c1fed6eedd0 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Wed, 28 Mar 2018 15:22:34 -0400 Subject: Permissions --- 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 2aa4f5c..e69a671 100644 --- a/backend/src/resolvers/Query.js +++ b/backend/src/resolvers/Query.js @@ -24,6 +24,7 @@ const Query = { async orders(parent, args, ctx, info) { const userId = getUserId(ctx); + console.log(info); return ctx.db.query.orders( { where: { @@ -33,6 +34,12 @@ const Query = { info ); }, + + async users(parent, args, ctx, info) { + console.log('TODO: check their permissions'); + const userId = getUserId(ctx); + return ctx.db.query.users({}, info); + }, }; module.exports = Query; -- cgit v1.3