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.

79 lines
1.5 KiB

  1. # ===============================================
  2. # ASSETS
  3. # ===============================================
  4. extend type Query {
  5. assets: AssetQuery
  6. }
  7. extend type Mutation {
  8. assets: AssetMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type AssetQuery {
  14. list(
  15. folderId: Int!
  16. kind: AssetKind!
  17. ): [AssetItem] @auth(requires: ["manage:system", "read:assets"])
  18. folders(
  19. parentFolderId: Int!
  20. ): [AssetFolder] @auth(requires: ["manage:system", "read:assets"])
  21. }
  22. # -----------------------------------------------
  23. # MUTATIONS
  24. # -----------------------------------------------
  25. type AssetMutation {
  26. createFolder(
  27. parentFolderId: Int!
  28. slug: String!
  29. name: String
  30. ): DefaultResponse @auth(requires: ["manage:system", "write:assets"])
  31. renameAsset(
  32. id: Int!
  33. filename: String!
  34. ): DefaultResponse @auth(requires: ["manage:system", "manage:assets"])
  35. deleteAsset(
  36. id: Int!
  37. ): DefaultResponse @auth(requires: ["manage:system", "manage:assets"])
  38. flushTempUploads: DefaultResponse @auth(requires: ["manage:system"])
  39. }
  40. # -----------------------------------------------
  41. # TYPES
  42. # -----------------------------------------------
  43. type AssetItem {
  44. id: Int!
  45. filename: String!
  46. ext: String!
  47. kind: AssetKind!
  48. mime: String!
  49. fileSize: Int!
  50. metadata: String
  51. createdAt: Date!
  52. updatedAt: Date!
  53. folder: AssetFolder
  54. author: User
  55. }
  56. type AssetFolder {
  57. id: Int!
  58. slug: String!
  59. name: String
  60. }
  61. enum AssetKind {
  62. IMAGE
  63. BINARY
  64. ALL
  65. }