diff --git a/src/graphql/schema.js b/src/graphql/schema.js index c808ea6121383710b2a080b2e189aea1342e4eb4..85e22808b6435cd8deb0e4a26b099e365730fe54 100644 --- a/src/graphql/schema.js +++ b/src/graphql/schema.js @@ -35,6 +35,8 @@ const typeDefs = ` type AdminMutation { + test: Boolean + createSubgroup( uid: ID = null, name: String, @@ -233,12 +235,27 @@ const resolvers = { Mutation: { asAdmin: (obj, args, context) => { - + return hasAdminRights(context.user, args.groupid).then(res => { + if(res) + return {hasAdminRights : true}; + else + return {hasAdminRights : false}; + }); }, createGroup: (obj, args, context) => { return createGroupIfLegal(context.user, args); } + }, + + AdminMutation: { + test: (obj, args, context) => { + console.log(obj); + console.log(typeof obj); + return null; + + } } + }; const schema = makeExecutableSchema({