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.

77 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. }
  39. # -----------------------------------------------
  40. # TYPES
  41. # -----------------------------------------------
  42. type AssetItem {
  43. id: Int!
  44. filename: String!
  45. ext: String!
  46. kind: AssetKind!
  47. mime: String!
  48. fileSize: Int!
  49. metadata: String
  50. createdAt: Date!
  51. updatedAt: Date!
  52. folder: AssetFolder
  53. author: User
  54. }
  55. type AssetFolder {
  56. id: Int!
  57. slug: String!
  58. name: String
  59. }
  60. enum AssetKind {
  61. IMAGE
  62. BINARY
  63. ALL
  64. }