mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
635 B
36 lines
635 B
|
|
/* global WIKI */
|
|
|
|
module.exports = {
|
|
Query: {
|
|
folders(obj, args, context, info) {
|
|
return WIKI.models.Folder.findAll({ where: args })
|
|
}
|
|
},
|
|
Mutation: {
|
|
createFolder(obj, args) {
|
|
return WIKI.models.Folder.create(args)
|
|
},
|
|
deleteFolder(obj, args) {
|
|
return WIKI.models.Folder.destroy({
|
|
where: {
|
|
id: args.id
|
|
},
|
|
limit: 1
|
|
})
|
|
},
|
|
renameFolder(obj, args) {
|
|
return WIKI.models.Folder.update({
|
|
name: args.name
|
|
}, {
|
|
where: { id: args.id }
|
|
})
|
|
}
|
|
},
|
|
Folder: {
|
|
files(grp) {
|
|
return grp.getFiles()
|
|
}
|
|
}
|
|
}
|