media.graphql 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. # Represents the preview image for a media.
  2. type MediaPreviewImage {
  3. # The preview image for the media. Returns null until status is READY.
  4. image: Image
  5. # Current status of the preview image.
  6. status: MediaPreviewImageStatus!
  7. }
  8. # Represents an image resource.
  9. type Image implements HasMetafields {
  10. # A word or phrase to share the nature or contents of an image.
  11. altText: String
  12. # The original height of the image in pixels. Returns null if the image is not hosted by Shopify.
  13. height: Int
  14. # A unique identifier for the image.
  15. id: ID
  16. # Returns a metafield by namespace and key that belongs to the resource.
  17. metafield(namespace: String!key: String!): Metafield
  18. # List of metafields that belong to the resource.
  19. metafields(
  20. namespace: String
  21. first: Int
  22. after: String
  23. last: Int
  24. before: String
  25. reverse: Boolean = false
  26. ): MetafieldConnection!
  27. # Returns a private metafield by namespace and key that belongs to the resource.
  28. privateMetafield(namespace: String!key: String!): PrivateMetafield
  29. # List of private metafields that belong to the resource.
  30. privateMetafields(
  31. namespace: String
  32. first: Int
  33. after: String
  34. last: Int
  35. before: String
  36. reverse: Boolean = false
  37. ): PrivateMetafieldConnection!
  38. # The location of the image as a URL.
  39. #
  40. # If no transform options are specified, then the original image will be preserved including any pre-applied transforms.
  41. # All transformation options are considered "best-effort". Any transformation that the original image type doesn't support will be ignored.
  42. # If you need multiple variations of the same image, then you can use GraphQL aliases.
  43. url(transform: ImageTransformInput): URL!
  44. # The original width of the image in pixels. Returns null if the image is not hosted by Shopify.
  45. width: Int
  46. }
  47. # The available options for transforming an image.
  48. #
  49. # All transformation options are considered best effort. Any transformation that the original image type doesn't support will be ignored.
  50. input ImageTransformInput {
  51. # The region of the image to remain after cropping.
  52. # Must be used in conjunction with the maxWidth and/or maxHeight fields, where the maxWidth and maxHeight aren't equal.
  53. # The crop argument should coincide with the smaller value. A smaller maxWidth indicates a LEFT or RIGHT crop, while
  54. # a smaller maxHeight indicates a TOP or BOTTOM crop. For example, { maxWidth: 5, maxHeight: 10, crop: LEFT } will result
  55. # in an image with a width of 5 and height of 10, where the right side of the image is removed.
  56. crop: CropRegion
  57. # Image width in pixels between 1 and 5760.
  58. maxWidth: Int
  59. # Image height in pixels between 1 and 5760.
  60. maxHeight: Int
  61. # Image size multiplier for high-resolution retina displays. Must be within 1..3.
  62. scale: Int = 1
  63. # Convert the source image into the preferred content type.
  64. # Supported conversions: .svg to .png, any file type to .jpg, and any file type to .webp.
  65. preferredContentType: ImageContentType
  66. }
  67. # Represents any file other than HTML.
  68. type GenericFile implements File&Node {
  69. #A word or phrase to describe the contents or the function of a file.
  70. alt: String
  71. # The date and time (ISO 8601 format) when the file was created.
  72. createdAt: DateTime!
  73. # Any errors that have occurred on the file.
  74. fileErrors: [FileError!]!
  75. # The status of the file.
  76. fileStatus: FileStatus!
  77. # A globally-unique identifier.
  78. id: ID!
  79. # The generic file's MIME type.
  80. mimeType: String
  81. # The generic file's size in bytes.
  82. originalFileSize: Int
  83. # The preview image for the media.
  84. preview: MediaPreviewImage
  85. # The generic file's URL.
  86. url: URL
  87. }
  88. type MediaImage implements File&Media&Node {
  89. # A word or phrase to share the nature or contents of a media.
  90. alt: String
  91. # The date and time (ISO 8601 format) when the file was created.
  92. createdAt: DateTime!
  93. # Any errors that have occurred on the file.
  94. fileErrors: [FileError!]!
  95. # The status of the file.
  96. fileStatus: FileStatus!
  97. # A globally-unique identifier.
  98. id: ID!
  99. # The image for the media. Returns null until status is READY.
  100. image: Image
  101. # The media content type.
  102. mediaContentType: MediaContentType!
  103. # Any errors which have occurred on the media.
  104. mediaErrors: [MediaError!]!
  105. # The warnings attached to the media.
  106. mediaWarnings: [MediaWarning!]!
  107. # The MIME type of the image.
  108. mimeType: String
  109. # The original source of the image.
  110. originalSource: MediaImageOriginalSource
  111. # The preview image for the media.
  112. preview: MediaPreviewImage
  113. # Current status of the media.
  114. status: MediaStatus!
  115. }
  116. # The original source for an image.
  117. type MediaImageOriginalSource {
  118. # The size of the original file in bytes.
  119. fileSize: Int
  120. }
  121. # Represents a Shopify hosted video.
  122. type Video implements File&Media&Node {
  123. # A word or phrase to share the nature or contents of a media.
  124. alt: String
  125. # The date and time (ISO 8601 format) when the file was created.
  126. createdAt: DateTime!
  127. # The video's duration in milliseconds. This value is null unless the video's status field is
  128. # READY.
  129. duration: Int
  130. # Any errors that have occurred on the file.
  131. fileErrors: [FileError!]!
  132. # The status of the file.
  133. fileStatus: FileStatus!
  134. # The video's filename.
  135. filename: String!
  136. # A globally-unique identifier.
  137. id: ID!
  138. # The media content type.
  139. mediaContentType: MediaContentType!
  140. # Any errors which have occurred on the media.
  141. mediaErrors: [MediaError!]!
  142. # The warnings attached to the media.
  143. mediaWarnings: [MediaWarning!]!
  144. # The video's original source. This value is null unless the video's status field is
  145. # READY.
  146. originalSource: VideoSource
  147. # The preview image for the media.
  148. preview: MediaPreviewImage
  149. # The video's sources. This value is empty unless the video's status field is
  150. # READY.
  151. sources: [VideoSource!]!
  152. # Current status of the media.
  153. status: MediaStatus!
  154. }
  155. # Represents a source for a Shopify hosted video.
  156. #
  157. # Types of sources include the original video, lower resolution versions of the original video,
  158. # and an m3u8 playlist file.
  159. #
  160. # Only videos with a status field
  161. # of READY have sources.
  162. type VideoSource {
  163. # The video source's file size in bytes.
  164. fileSize: Int
  165. # The video source's file format extension.
  166. format: String!
  167. # The video source's height.
  168. height: Int!
  169. # The video source's MIME type.
  170. mimeType: String!
  171. # The video source's URL.
  172. url: String!
  173. # The video source's width.
  174. width: Int!
  175. }