meta.graphql 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. # Metafields enable you to attach additional information to a Shopify resource, such as a Product or a Collection.
  2. # For more information about where you can attach metafields refer to HasMetafields.
  3. # Some examples of the data that metafields enable you to store are specifications, size charts, downloadable documents, release dates, images, or part numbers.
  4. # Metafields are identified by an owner resource, namespace, and key. and store a value along with type information for that value.
  5. type Metafield implements LegacyInteroperability&Node{
  6. # The date and time when the metafield was created.
  7. createdAt: DateTime!
  8. # The optional, associated metafield definition that maps to this metafield's namespace and key pair.
  9. definition: MetafieldDefinition
  10. # The description of the metafield.
  11. description: String
  12. # A globally-unique identifier.
  13. id: ID!
  14. # The unique identifier for the metafield in its namespace.
  15. key: String!
  16. # The ID of the corresponding resource in the REST Admin API.
  17. legacyResourceId: UnsignedInt64!
  18. # A container for a group of metafields.
  19. # Grouping metafields within a namespace prevents your metafields from conflicting with other metafields that have the same key name.
  20. namespace: String!
  21. # The resource that the metafield is attached to.
  22. owner: HasMetafields!
  23. # The resource that the metafield is attached to.
  24. ownerType: MetafieldOwnerType!
  25. # Returns a reference object if the metafield definition's type is a resource reference.
  26. reference: MetafieldReference
  27. # A list of reference objects if the metafield's type is a resource reference list.
  28. references(
  29. first: Int
  30. after: String
  31. last: Int
  32. before: String
  33. ): MetafieldReferenceConnection
  34. # The type of data that the metafield stores in the value field.
  35. # See the list of supported types.
  36. type: String!
  37. # The date and time when the metafield was updated.
  38. updatedAt: DateTime!
  39. # The data to store in the metafield. The data is always stored as a string, regardless of the metafield's type.
  40. value: String!
  41. }
  42. # Metafield definitions enable you to define additional validation constraints for metafields, and enable the
  43. # merchant to edit metafield values in context.
  44. type MetafieldDefinition implements Node {
  45. # The description of a metafield definition.
  46. description: String
  47. # A globally-unique identifier.
  48. id: ID!
  49. # The key name used to identify a metafield definition within a namespace.
  50. key: String!
  51. # The list of metafields associated with a metafield definition.
  52. metafields(
  53. validationStatus: MetafieldValidationStatus = ANY
  54. first: Int
  55. after: String
  56. last: Int
  57. before: String
  58. reverse: Boolean = false
  59. ): MetafieldConnection!
  60. # The count of metafields under a metafield definition.
  61. metafieldsCount(validationStatus: MetafieldValidationStatus): Int!
  62. # The human-readable name for the metafield definition.
  63. name: String!
  64. # The namespace of the metafield definition. You can use a namespace to group related metafields.
  65. namespace: String!
  66. # The resource type that the metafield definition is attached to. For example, Product or Collection.
  67. ownerType: MetafieldOwnerType!
  68. # The position of the metafield definition in the pinned list.
  69. pinnedPosition: Int
  70. # The standard metafield definition template associated with a metafield definition.
  71. standardTemplate: StandardMetafieldDefinitionTemplate
  72. # The type of data that the metafield will store.
  73. type: MetafieldDefinitionType!
  74. # The validation status for the existing metafields within a metafield definition.
  75. validationStatus: MetafieldDefinitionValidationStatus!
  76. # A list of validation options for
  77. # the metafield. For example, for a metafield with the type date, you can set a minimum date validation, so
  78. # that the metafield will only store dates after the specific minimum date.
  79. validations: [MetafieldDefinitionValidation!]!
  80. # Whether metafields for the metafield definition are visible using the Storefront API.
  81. visibleToStorefrontApi: Boolean!
  82. }
  83. # Standard metafield definition templates provide preset configurations to create metafield definitions.
  84. # Each template has a specific namespace and key that we've reserved to have specific meanings for common use cases.
  85. #
  86. # Refer to the list of standard metafield definitions.
  87. type StandardMetafieldDefinitionTemplate implements Node {
  88. # The description of the standard metafield definition.
  89. description: String
  90. # A globally-unique identifier.
  91. id: ID!
  92. # The key owned by the definition after the definition has been activated.
  93. key: String!
  94. # The human-readable name for the standard metafield definition.
  95. name: String!
  96. # The namespace owned by the definition after the definition has been activated.
  97. namespace: String!
  98. # The list of resource types that the standard metafield definition can be applied to.
  99. ownerTypes: [MetafieldOwnerType!]!
  100. # The associated metafield definition type that the metafield stores.
  101. type: MetafieldDefinitionType!
  102. # The configured validations for the standard metafield definition.
  103. validations: [MetafieldDefinitionValidation!]!
  104. # Whether metafields for the definition are by default visible using the Storefront API.
  105. visibleToStorefrontApi: Boolean!
  106. }
  107. # A metafield definition type provides basic foundation and validation for a metafield.
  108. type MetafieldDefinitionType {
  109. # The category associated with the metafield definition type.
  110. category: String!
  111. # The name of the type for the metafield definition.
  112. # See the list of supported types.
  113. name: String!
  114. # The supported validations for a metafield definition type.
  115. supportedValidations: [MetafieldDefinitionSupportedValidation!]!
  116. # Whether metafields without a definition can be migrated to a definition of this type.
  117. supportsDefinitionMigrations: Boolean!
  118. }
  119. # The type and name for the optional validation configuration of a metafield.
  120. #
  121. # For example, a supported validation might consist of a max name and a number_integer type.
  122. # This validation can then be used to enforce a maximum character length for a single_line_text_field metafield.
  123. type MetafieldDefinitionSupportedValidation {
  124. # The name of the metafield definition validation.
  125. name: String!
  126. # The type of input for the validation.
  127. type: String!
  128. }
  129. # A configured metafield definition validation.
  130. #
  131. # For example, for a metafield definition of number_integer type, you can set a validation with the name max
  132. # and a value of 15. This validation will ensure that the value of the metafield is a number less than or equal to 15.
  133. #
  134. # Refer to the list of supported validations.
  135. type MetafieldDefinitionValidation {
  136. # The validation name.
  137. name: String!
  138. # The name for the metafield type of this validation.
  139. type: String!
  140. # The validation value.
  141. value: String
  142. }
  143. # Private metafields represent custom metadata that is attached to a resource.
  144. # Private metafields are accessible only by the application that created them and only from the GraphQL Admin API.
  145. #
  146. # An application can create a maximum of 10 private metafields per shop resource.
  147. type PrivateMetafield implements Node {
  148. # The date and time when the private metafield was created.
  149. createdAt: DateTime!
  150. # The id of the private metafield.
  151. id: ID!
  152. # The key name of the private metafield.
  153. key: String!
  154. # The namespace of the private metafield.
  155. namespace: String!
  156. # The date and time when the private metafield was updated.
  157. updatedAt: DateTime!
  158. # The value of a private metafield.
  159. value: String!
  160. # Represents the private metafield value type.
  161. valueType: PrivateMetafieldValueType!
  162. }
  163. # The input fields for a private metafield.
  164. input PrivateMetafieldInput {
  165. # The resource that owns the metafield. If the field is blank, then the Shop resource owns the metafield.
  166. owner: ID
  167. # The namespace of the private metafield.
  168. namespace: String!
  169. # The key of the private metafield.
  170. key: String!
  171. # The value and valueType of the private metafield, wrapped in a ValueInput object.
  172. valueInput: PrivateMetafieldValueInput!
  173. }
  174. # The value input contains the value and value type of the private metafield.
  175. input PrivateMetafieldValueInput {
  176. # The value of a private metafield.
  177. value: String!
  178. # Represents the private metafield value type.
  179. valueType: PrivateMetafieldValueType!
  180. }
  181. # The input fields to use to create or update a metafield through a mutation on the owning resource.
  182. # An alternative way to create or update a metafield is by using the metafieldsSet mutation.
  183. input MetafieldInput {
  184. # The description of the metafield.
  185. description: String
  186. # The unique ID of the metafield. You don't include an ID when you create a metafield because the metafield ID
  187. # is created automatically. The ID is required when you update a metafield.
  188. id: ID
  189. # The namespace for a metafield. The namespace is required when you create a metafield and is optional when you
  190. # update a metafield.
  191. namespace: String
  192. # The key name of the metafield. Required when creating but optional when updating.
  193. key: String
  194. # The value of a metafield.
  195. value: String
  196. # The metafield's type. The metafield type is required
  197. # when you create a metafield and is optional when you update a metafield.
  198. type: String
  199. }
  200. # An auto-generated type for paginating through multiple Metafields.
  201. type MetafieldConnection {
  202. # A list of edges.
  203. edges: [MetafieldEdge!]!
  204. # A list of the nodes contained in MetafieldEdge.
  205. nodes: [Metafield!]!
  206. # Information to aid in pagination.
  207. pageInfo: PageInfo!
  208. }
  209. # An auto-generated type which holds one Metafield and a cursor during pagination.
  210. type MetafieldEdge {
  211. # A cursor for use in pagination.
  212. cursor: String!
  213. # The item at the end of MetafieldEdge.
  214. node: Metafield!
  215. }
  216. # An auto-generated type for paginating through multiple MetafieldDefinitions.
  217. type MetafieldDefinitionConnection {
  218. # A list of edges.
  219. edges: [MetafieldDefinitionEdge!]!
  220. # A list of the nodes contained in MetafieldDefinitionEdge.
  221. nodes: [MetafieldDefinition!]!
  222. # Information to aid in pagination.
  223. pageInfo: PageInfo!
  224. }
  225. # An auto-generated type which holds one MetafieldDefinition and a cursor during pagination.
  226. type MetafieldDefinitionEdge {
  227. # A cursor for use in pagination.
  228. cursor: String!
  229. # The item at the end of MetafieldDefinitionEdge.
  230. node: MetafieldDefinition!
  231. }
  232. # An auto-generated type for paginating through multiple PrivateMetafields.
  233. type PrivateMetafieldConnection {
  234. # A list of edges.
  235. edges: [PrivateMetafieldEdge!]!
  236. # A list of the nodes contained in PrivateMetafieldEdge.
  237. nodes: [PrivateMetafield!]!
  238. # Information to aid in pagination.
  239. pageInfo: PageInfo!
  240. }
  241. # An auto-generated type which holds one PrivateMetafield and a cursor during pagination.
  242. type PrivateMetafieldEdge {
  243. # A cursor for use in pagination.
  244. cursor: String!
  245. # The item at the end of PrivateMetafieldEdge.
  246. node: PrivateMetafield!
  247. }
  248. # An auto-generated type for paginating through multiple MetafieldReferences.
  249. type MetafieldReferenceConnection {
  250. # A list of edges.
  251. edges: [MetafieldReferenceEdge!]!
  252. # A list of the nodes contained in MetafieldReferenceEdge.
  253. nodes: [MetafieldReference]!
  254. # Information to aid in pagination.
  255. pageInfo: PageInfo!
  256. }
  257. # An auto-generated type which holds one MetafieldReference and a cursor during pagination.
  258. type MetafieldReferenceEdge {
  259. # A cursor for use in pagination.
  260. cursor: String!
  261. # The item at the end of MetafieldReferenceEdge.
  262. node: MetafieldReference
  263. }