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
631 B

  1. 'use strict'
  2. /* global wiki */
  3. module.exports = {
  4. Query: {
  5. folders(obj, args, context, info) {
  6. return wiki.db.Folder.findAll({ where: args })
  7. }
  8. },
  9. Mutation: {
  10. createFolder(obj, args) {
  11. return wiki.db.Folder.create(args)
  12. },
  13. deleteGroup(obj, args) {
  14. return wiki.db.Folder.destroy({
  15. where: {
  16. id: args.id
  17. },
  18. limit: 1
  19. })
  20. },
  21. renameFolder(obj, args) {
  22. return wiki.db.Folder.update({
  23. name: args.name
  24. }, {
  25. where: { id: args.id }
  26. })
  27. }
  28. },
  29. Folder: {
  30. files(grp) {
  31. return grp.getFiles()
  32. }
  33. }
  34. }