feat: GraphQL mutations for folder, group, tag, user
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
'use strict'
|
||||
|
||||
/* global wiki */
|
||||
|
||||
module.exports = {
|
||||
Query: {
|
||||
folders(obj, args, context, info) {
|
||||
return wiki.db.Folder.findAll({ where: args })
|
||||
}
|
||||
},
|
||||
Mutation: {
|
||||
createFolder(obj, args) {
|
||||
return wiki.db.Folder.create(args)
|
||||
},
|
||||
deleteGroup(obj, args) {
|
||||
return wiki.db.Folder.destroy({
|
||||
where: {
|
||||
id: args.id
|
||||
},
|
||||
limit: 1
|
||||
})
|
||||
}
|
||||
},
|
||||
Folder: {
|
||||
files(grp) {
|
||||
return grp.getFiles()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user