tree.graphql 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # ===============================================
  2. # TREE
  3. # ===============================================
  4. extend type Query {
  5. tree(
  6. siteId: UUID!
  7. parentId: UUID
  8. parentPath: String
  9. types: [TreeItemType]
  10. limit: Int
  11. offset: Int
  12. orderBy: TreeOrderBy
  13. orderByDirection: OrderByDirection
  14. depth: Int
  15. includeAncestors: Boolean
  16. ): [TreeItem]
  17. folderById(
  18. id: UUID!
  19. ): TreeItemFolder
  20. }
  21. extend type Mutation {
  22. createFolder(
  23. siteId: UUID!
  24. parentId: UUID
  25. pathName: String!
  26. title: String!
  27. ): DefaultResponse
  28. deleteFolder(
  29. folderId: UUID!
  30. ): DefaultResponse
  31. duplicateFolder(
  32. folderId: UUID!
  33. targetParentId: UUID
  34. targetPathName: String!
  35. targetTitle: String!
  36. ): DefaultResponse
  37. moveFolder(
  38. folderId: UUID!
  39. targetParentId: UUID
  40. ): DefaultResponse
  41. renameFolder(
  42. folderId: UUID!
  43. pathName: String!
  44. title: String!
  45. ): DefaultResponse
  46. }
  47. # -----------------------------------------------
  48. # TYPES
  49. # -----------------------------------------------
  50. enum TreeItemType {
  51. asset
  52. folder
  53. page
  54. }
  55. enum TreeOrderBy {
  56. createdAt
  57. fileName
  58. title
  59. updatedAt
  60. }
  61. type TreeItemFolder {
  62. id: UUID
  63. childrenCount: Int
  64. depth: Int
  65. fileName: String
  66. folderPath: String
  67. title: String
  68. }
  69. type TreeItemPage {
  70. id: UUID
  71. createdAt: Date
  72. depth: Int
  73. fileName: String
  74. folderPath: String
  75. editor: String
  76. pageType: String
  77. title: String
  78. updatedAt: Date
  79. }
  80. type TreeItemAsset {
  81. id: UUID
  82. createdAt: Date
  83. depth: Int
  84. fileName: String
  85. # In Bytes
  86. fileSize: Int
  87. fileType: String
  88. folderPath: String
  89. title: String
  90. updatedAt: Date
  91. }
  92. union TreeItem = TreeItemFolder | TreeItemPage | TreeItemAsset