asset.graphql 968 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # ===============================================
  2. # ASSETS
  3. # ===============================================
  4. extend type Query {
  5. assetById(
  6. id: UUID!
  7. ): [AssetItem]
  8. }
  9. extend type Mutation {
  10. renameAsset(
  11. id: UUID!
  12. filename: String!
  13. ): DefaultResponse
  14. deleteAsset(
  15. id: UUID!
  16. ): DefaultResponse
  17. """
  18. Upload one or more assets.
  19. Must provide either `folderId` or a combination of `folderPath`, `locale` and `siteId`.
  20. """
  21. uploadAssets(
  22. folderId: UUID
  23. folderPath: String
  24. locale: String
  25. siteId: UUID
  26. files: [Upload!]!
  27. ): DefaultResponse
  28. flushTempUploads: DefaultResponse
  29. }
  30. # -----------------------------------------------
  31. # TYPES
  32. # -----------------------------------------------
  33. type AssetItem {
  34. id: UUID
  35. filename: String
  36. ext: String
  37. kind: AssetKind
  38. mime: String
  39. fileSize: Int
  40. metadata: JSON
  41. createdAt: Date
  42. updatedAt: Date
  43. author: User
  44. }
  45. enum AssetKind {
  46. document
  47. image
  48. other
  49. }