Skip to content
Snippets Groups Projects
Commit 4dabba64 authored by Anatole ROMON's avatar Anatole ROMON
Browse files

Creation d'un resolve GraphQl de base qui fonctionne

parent a5b72d48
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment