From 4dabba64299955b3fa1d04142591cae66cc00557 Mon Sep 17 00:00:00 2001 From: anatole <anatole.romon@polytechnique.edu> Date: Thu, 1 Mar 2018 13:24:09 +0100 Subject: [PATCH] Creation d'un resolve GraphQl de base qui fonctionne --- src/graphql/schema.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/graphql/schema.js b/src/graphql/schema.js index c120901..9db49a7 100644 --- a/src/graphql/schema.js +++ b/src/graphql/schema.js @@ -25,12 +25,14 @@ const typeDefs = ` `; const getAllVisibleGroups = (user) => { + console.log("getAllVisibleGroups gets called") // let group_ids = listGroups(user.id); return knex.select().from('groups')/*.whereIn('id', group_ids)*/; }; const getGroupIfVisible = (user, id) => { - return getAllVisibleGroups(user)/*.where('id', id).then(function(table) { + console.log("getGroupIfVisible gets called") + return getAllVisibleGroups(user).where('id', id)/*.then(function(table) { console.log(JSON.stringify(table,null,2))*/; }; @@ -40,7 +42,6 @@ const resolvers = { return getAllVisibleGroups(context.user); }, group: (obj, args, context) => { - console.log(args.id); return getGroupIfVisible(context.user, args.id); } } -- GitLab