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.

35 lines
618 B

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