feat: GraphQL mutations for User + Group

This commit is contained in:
NGPixel
2017-08-08 22:36:29 -04:00
parent e0b788501d
commit 7e1cb3d171
5 changed files with 58 additions and 18 deletions

View File

@@ -3,10 +3,17 @@
/* global wiki */
module.exports = {
Query(obj, args, context, info) {
return wiki.db.Group.findAll({ where: args })
Query: {
groups(obj, args, context, info) {
return wiki.db.Group.findAll({ where: args })
}
},
Type: {
Mutation: {
createGroup(obj, args) {
return wiki.db.Group.create(args)
}
},
Group: {
users(grp) {
return grp.getUsers()
}