asset.graphql 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. root: String
  16. kind: AssetKind
  17. ): [AssetItem] @auth(requires: ["manage:system", "read:assets"])
  18. }
  19. # -----------------------------------------------
  20. # MUTATIONS
  21. # -----------------------------------------------
  22. type AssetMutation {
  23. upload(
  24. data: Upload!
  25. ): DefaultResponse
  26. }
  27. # -----------------------------------------------
  28. # TYPES
  29. # -----------------------------------------------
  30. type AssetItem {
  31. id: Int!
  32. filename: String!
  33. ext: String!
  34. kind: AssetKind!
  35. mime: String!
  36. fileSize: Int!
  37. metadata: String
  38. createdAt: Date!
  39. updatedAt: Date!
  40. folder: AssetFolder
  41. author: User
  42. }
  43. type AssetFolder {
  44. id: Int!
  45. }
  46. enum AssetKind {
  47. IMAGE
  48. BINARY
  49. ALL
  50. }