product.graphql 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. # The Product resource lets you manage products in a merchant’s store.
  2. # You can use ProductVariants to create or update different versions of the same product.
  3. # You can also add or update product Media. Products can be organized by grouping them into a Collection.
  4. type Product
  5. implements HasMetafieldDefinitions&HasMetafields&HasPublishedTranslations&LegacyInteroperability&Navigable&Node&OnlineStorePreviewable&Publishable
  6. @key(fields: "id") {
  7. # The number of publications a resource is published to without feedback errors.
  8. availablePublicationCount: Int!
  9. # A list of the collections that include the product.
  10. collections(
  11. first: Int
  12. after: String
  13. last: Int
  14. before: String
  15. reverse: Boolean = false
  16. sortKey: CollectionSortKeys = ID
  17. query: String
  18. ): CollectionConnection!
  19. # The pricing that applies for a customer in a given context.
  20. contextualPricing(context: ContextualPricingContext!): ProductContextualPricing!
  21. # The date and time (ISO 8601 format) when the product was created.
  22. createdAt: DateTime!
  23. # A default cursor that returns the single next record, sorted ascending by ID.
  24. defaultCursor: String!
  25. # A stripped description of the product, single line with HTML tags removed.
  26. description(truncateAt: Int): String!
  27. # The description of the product, complete with HTML formatting.
  28. descriptionHtml: HTML!
  29. # The featured image for the product.
  30. featuredImage: Image
  31. # The featured media for the product.
  32. featuredMedia: Media
  33. # Information about the product that's provided through resource feedback.
  34. feedback: ResourceFeedback
  35. # The theme template used when viewing the gift card in a store.
  36. giftCardTemplateSuffix: String
  37. # A unique human-friendly string of the product's title.
  38. handle: String!
  39. # Whether the product has only a single variant with the default option and value.
  40. hasOnlyDefaultVariant: Boolean!
  41. # Whether the product has out of stock variants.
  42. hasOutOfStockVariants: Boolean!
  43. # A globally-unique identifier.
  44. id: ID!
  45. # The images associated with the product.
  46. images(
  47. first: Int
  48. after: String
  49. last: Int
  50. before: String
  51. reverse: Boolean = false
  52. sortKey: ProductImageSortKeys = POSITION
  53. ): ImageConnection!
  54. # Whether the product is in a given collection.
  55. inCollection(id: ID!): Boolean!
  56. # Whether the product is a gift card.
  57. isGiftCard: Boolean!
  58. # The ID of the corresponding resource in the REST Admin API.
  59. legacyResourceId: UnsignedInt64!
  60. # The media associated with the product. This can include images, 3D models, or videos.
  61. media(
  62. first: Int
  63. after: String
  64. last: Int
  65. before: String
  66. reverse: Boolean = false
  67. sortKey: ProductMediaSortKeys = POSITION
  68. ): MediaConnection!
  69. # Total count of media belonging to a product.
  70. mediaCount: Int!
  71. # Returns a metafield by namespace and key that belongs to the resource.
  72. metafield(namespace: String!key: String!): Metafield
  73. # List of metafield definitions.
  74. metafieldDefinitions(
  75. namespace: String
  76. pinnedStatus: MetafieldDefinitionPinnedStatus = ANY
  77. first: Int
  78. after: String
  79. last: Int
  80. before: String
  81. reverse: Boolean = false
  82. sortKey: MetafieldDefinitionSortKeys = ID
  83. query: String
  84. ): MetafieldDefinitionConnection!
  85. # List of metafields that belong to the resource.
  86. metafields(
  87. namespace: String
  88. first: Int
  89. after: String
  90. last: Int
  91. before: String
  92. reverse: Boolean = false
  93. ): MetafieldConnection!
  94. # The online store preview URL.
  95. onlineStorePreviewUrl: URL
  96. # The online store URL for the product.
  97. # A value of null indicates that the product is not published to the Online Store sales channel.
  98. onlineStoreUrl: URL
  99. # A list of product options. The limit is specified by Shop.resourceLimits.maxProductOptions.
  100. options(first: Int): [ProductOption!]!
  101. # The price range of the product with prices formatted as decimals.
  102. priceRangeV2: ProductPriceRangeV2!
  103. # Returns a private metafield by namespace and key that belongs to the resource.
  104. privateMetafield(namespace: String!key: String!): PrivateMetafield
  105. # List of private metafields that belong to the resource.
  106. privateMetafields(
  107. namespace: String
  108. first: Int
  109. after: String
  110. last: Int
  111. before: String
  112. reverse: Boolean = false
  113. ): PrivateMetafieldConnection!
  114. # The product category specified by the merchant.
  115. productCategory: ProductCategory
  116. # The product type specified by the merchant.
  117. productType: String!
  118. # The number of publications a resource is published on.
  119. publicationCount(onlyPublished: Boolean = true): Int!
  120. # The date and time (ISO 8601 format) when the product was published to the Online Store.
  121. publishedAt: DateTime
  122. # Check to see whether the resource is published to the calling app's publication.
  123. publishedOnCurrentPublication: Boolean!
  124. # Check to see whether the resource is published to a given publication.
  125. publishedOnPublication(publicationId: ID!): Boolean!
  126. # Whether the product can only be purchased with a selling plan (subscription).
  127. # Products that are sold on subscription (requiresSellingPlan: true) can be updated only for online stores.
  128. # If you update a product to be subscription only, then the product is unpublished from all channels except the online store.
  129. requiresSellingPlan: Boolean!
  130. # The resource that is either published or staged to be published to the calling app's publication.
  131. # Requires the read_product_listings scope.
  132. resourcePublicationOnCurrentPublication: ResourcePublicationV2
  133. # The list of resources that are published to a publication.
  134. resourcePublications(
  135. onlyPublished: Boolean = true
  136. first: Int
  137. after: String
  138. last: Int
  139. before: String
  140. reverse: Boolean = false
  141. ): ResourcePublicationConnection!
  142. # The list of resources that are either published or staged to be published to a publication.
  143. resourcePublicationsV2(
  144. onlyPublished: Boolean = true
  145. first: Int
  146. after: String
  147. last: Int
  148. before: String
  149. reverse: Boolean = false
  150. ): ResourcePublicationV2Connection!
  151. # Count of selling plan groups associated with the product.
  152. sellingPlanGroupCount: Int!
  153. # A list of all selling plan groups defined in the current shop associated with the product either directly or through any of its variants.
  154. sellingPlanGroups(
  155. first: Int
  156. after: String
  157. last: Int
  158. before: String
  159. reverse: Boolean = false
  160. ): SellingPlanGroupConnection!
  161. # SEO information of the product.
  162. seo: SEO!
  163. # The product status. This controls visibility across all channels.
  164. status: ProductStatus!
  165. # A comma separated list of tags associated with the product. Updating tags overwrites
  166. # any existing tags that were previously added to the product. To add new tags without overwriting
  167. # existing tags, use the tagsAdd mutation.
  168. tags: [String!]!
  169. # The theme template used when viewing the product in a store.
  170. templateSuffix: String
  171. # The title of the product.
  172. title: String!
  173. # The quantity of inventory in stock.
  174. totalInventory: Int!
  175. # The number of variants that are associated with the product.
  176. totalVariants: Int!
  177. # Whether inventory tracking has been enabled for the product.
  178. tracksInventory: Boolean!
  179. # The translations associated with the resource.
  180. translations(locale: String!marketId: ID): [PublishedTranslation!]!
  181. # The list of publications that the resource is not published to.
  182. unpublishedPublications(
  183. first: Int
  184. after: String
  185. last: Int
  186. before: String
  187. reverse: Boolean = false
  188. ): PublicationConnection!
  189. # The date and time when the product was last modified.
  190. # A product's updatedAt value can change for different reasons. For example, if an order
  191. # is placed for a product that has inventory tracking set up, then the inventory adjustment
  192. # is counted as an update.
  193. updatedAt: DateTime!
  194. # A list of variants associated with the product.
  195. variants(
  196. first: Int
  197. after: String
  198. last: Int
  199. before: String
  200. reverse: Boolean = false
  201. sortKey: ProductVariantSortKeys = POSITION
  202. ): ProductVariantConnection!
  203. # The name of the product's vendor.
  204. vendor: String!
  205. }
  206. # Represents a product variant.
  207. type ProductVariant implements HasMetafieldDefinitions&HasMetafields&HasPublishedTranslations&LegacyInteroperability&Navigable&Node {
  208. # Whether the product variant is available for sale.
  209. availableForSale: Boolean!
  210. # The value of the barcode associated with the product.
  211. barcode: String
  212. # The compare-at price of the variant in the default shop currency.
  213. compareAtPrice: Money
  214. # The pricing that applies for a customer in a given context.
  215. contextualPricing(context: ContextualPricingContext!): ProductVariantContextualPricing!
  216. # The date and time when the variant was created.
  217. createdAt: DateTime!
  218. # A default cursor that returns the single next record, sorted ascending by ID.
  219. defaultCursor: String!
  220. # The delivery profile for the variant.
  221. deliveryProfile: DeliveryProfile
  222. # Display name of the variant, based on product's title + variant's title.
  223. displayName: String!
  224. # Whether changes to the fulfillment service for the product variant are allowed.
  225. fulfillmentServiceEditable: EditableProperty!
  226. # A globally-unique identifier.
  227. id: ID!
  228. # The featured image for the variant.
  229. image: Image
  230. # The inventory item, which is used to query for inventory information.
  231. inventoryItem: InventoryItem!
  232. # Whether customers are allowed to place an order for the product variant when it's out of stock.
  233. inventoryPolicy: ProductVariantInventoryPolicy!
  234. # The total sellable quantity of the variant.
  235. inventoryQuantity: Int
  236. # The ID of the corresponding resource in the REST Admin API.
  237. legacyResourceId: UnsignedInt64!
  238. # The media associated with the product variant.
  239. media(
  240. first: Int
  241. after: String
  242. last: Int
  243. before: String
  244. reverse: Boolean = false
  245. ): MediaConnection!
  246. # Returns a metafield by namespace and key that belongs to the resource.
  247. metafield(namespace: String!key: String!): Metafield
  248. # List of metafield definitions.
  249. metafieldDefinitions(
  250. namespace: String
  251. pinnedStatus: MetafieldDefinitionPinnedStatus = ANY
  252. first: Int
  253. after: String
  254. last: Int
  255. before: String
  256. reverse: Boolean = false
  257. sortKey: MetafieldDefinitionSortKeys = ID
  258. query: String
  259. ): MetafieldDefinitionConnection!
  260. # List of metafields that belong to the resource.
  261. metafields(
  262. namespace: String
  263. first: Int
  264. after: String
  265. last: Int
  266. before: String
  267. reverse: Boolean = false
  268. ): MetafieldConnection!
  269. # The order of the product variant in the list of product variants. The first position in the list is 1.
  270. position: Int!
  271. # The price of the product variant in the default shop currency.
  272. price: Money!
  273. # Returns a private metafield by namespace and key that belongs to the resource.
  274. privateMetafield(namespace: String!key: String!): PrivateMetafield
  275. # List of private metafields that belong to the resource.
  276. privateMetafields(
  277. namespace: String
  278. first: Int
  279. after: String
  280. last: Int
  281. before: String
  282. reverse: Boolean = false
  283. ): PrivateMetafieldConnection!
  284. # The product that this variant belongs to.
  285. product: Product!
  286. # List of product options applied to the variant.
  287. selectedOptions: [SelectedOption!]!
  288. # The total sellable quantity of the variant for online channels.
  289. # This doesn't represent the total available inventory or capture
  290. # limitations based on customer location.
  291. sellableOnlineQuantity: Int!
  292. # Count of selling plan groups associated with the product variant.
  293. sellingPlanGroupCount: Int!
  294. # A list of all selling plan groups defined in the current shop associated with the product variant.
  295. sellingPlanGroups(
  296. first: Int
  297. after: String
  298. last: Int
  299. before: String
  300. reverse: Boolean = false
  301. ): SellingPlanGroupConnection!
  302. # An identifier for the product variant in the shop. Required in order to connect to a fulfillment service.
  303. sku: String
  304. # The tax code for the product variant.
  305. taxCode: String
  306. # Whether a tax is charged when the product variant is sold.
  307. taxable: Boolean!
  308. # The title of the product variant.
  309. title: String!
  310. # The translations associated with the resource.
  311. translations(locale: String!marketId: ID): [PublishedTranslation!]!
  312. # The date and time (ISO 8601 format) when the product variant was last modified.
  313. updatedAt: DateTime!
  314. # The weight of the product variant in the unit system specified with weight_unit.
  315. weight: Float
  316. # The unit of measurement that applies to the product variant's weight.
  317. # If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, lb.
  318. weightUnit: WeightUnit!
  319. }
  320. # The product property names. For example, "Size", "Color", and "Material".
  321. # Variants are selected based on permutations of these options.
  322. # The limit for each product property name is 255 characters.
  323. type ProductOption implements HasPublishedTranslations&Node {
  324. # A globally-unique identifier.
  325. id: ID!
  326. # The product option’s name.
  327. name: String!
  328. # The product option's position.
  329. position: Int!
  330. # The translations associated with the resource.
  331. translations(locale: String!marketId: ID): [PublishedTranslation!]!
  332. # The corresponding value to the product option name.
  333. values: [String!]!
  334. }
  335. # The details of a specific product category within the Shopify product taxonomy.
  336. type ProductCategory {
  337. # The product taxonomy node associated with the product category.
  338. productTaxonomyNode: ProductTaxonomyNode
  339. }
  340. # Represents a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire, shoes, and accessories.
  341. #
  342. # Collections can be defined by conditions, such as whether they match certain product tags.
  343. # These are called smart or automated collections.
  344. #
  345. # Collections can also be created for a custom group of products. These are called custom or manual collections.
  346. type Collection implements HasMetafieldDefinitions&HasMetafields&HasPublishedTranslations&Node&Publishable {
  347. # The number of publications a resource is published to without feedback errors.
  348. availablePublicationCount: Int!
  349. # A single-line, text-only description of the collection, stripped of any HTML tags and formatting that were included in the description.
  350. description(truncateAt: Int): String!
  351. # The description of the collection, including any HTML tags and formatting.
  352. # This content is typically displayed to customers, such as on an online store, depending on the theme.
  353. descriptionHtml: HTML!
  354. # Information about the collection that's provided through resource feedback.
  355. feedback: ResourceFeedback
  356. # A unique string that identifies the collection. If a handle isn't specified when a collection is created, it's automatically generated from the collection's original title, and typically includes words from the title separated by hyphens. For example, a collection that was created with the title Summer Catalog 2022 might have the handle summer-catalog-2022.
  357. #
  358. # If the title is changed, the handle doesn't automatically change.
  359. #
  360. # The handle can be used in themes by the Liquid templating language to refer to the collection, but using the ID is preferred because it never changes.
  361. handle: String!
  362. # Whether the collection includes the specified product.
  363. hasProduct(id: ID!): Boolean!
  364. # A globally-unique identifier.
  365. id: ID!
  366. # The image associated with the collection.
  367. image: Image
  368. # The ID of the corresponding resource in the REST Admin API.
  369. legacyResourceId: UnsignedInt64!
  370. # Returns a metafield by namespace and key that belongs to the resource.
  371. metafield(namespace: String!key: String!): Metafield
  372. # List of metafield definitions.
  373. metafieldDefinitions(
  374. namespace: String
  375. pinnedStatus: MetafieldDefinitionPinnedStatus = ANY
  376. first: Int
  377. after: String
  378. last: Int
  379. before: String
  380. reverse: Boolean = false
  381. sortKey: MetafieldDefinitionSortKeys = ID
  382. query: String
  383. ): MetafieldDefinitionConnection!
  384. # List of metafields that belong to the resource.
  385. metafields(
  386. namespace: String
  387. first: Int
  388. after: String
  389. last: Int
  390. before: String
  391. reverse: Boolean = false
  392. ): MetafieldConnection!
  393. # Returns a private metafield by namespace and key that belongs to the resource.
  394. privateMetafield(namespace: String!key: String!): PrivateMetafield
  395. # List of private metafields that belong to the resource.
  396. privateMetafields(
  397. namespace: String
  398. first: Int
  399. after: String
  400. last: Int
  401. before: String
  402. reverse: Boolean = false
  403. ): PrivateMetafieldConnection!
  404. # The products that are included in the collection.
  405. products(
  406. first: Int
  407. after: String
  408. last: Int
  409. before: String
  410. reverse: Boolean = false
  411. sortKey: ProductCollectionSortKeys = COLLECTION_DEFAULT
  412. ): ProductConnection!
  413. # The number of products in the collection.
  414. productsCount: Int!
  415. # The number of publications a resource is published on.
  416. publicationCount(onlyPublished: Boolean = true): Int!
  417. # Check to see whether the resource is published to the calling app's publication.
  418. publishedOnCurrentPublication: Boolean!
  419. # Check to see whether the resource is published to a given publication.
  420. publishedOnPublication(publicationId: ID!): Boolean!
  421. # The list of resources that are published to a publication.
  422. resourcePublications(
  423. onlyPublished: Boolean = true
  424. first: Int
  425. after: String
  426. last: Int
  427. before: String
  428. reverse: Boolean = false
  429. ): ResourcePublicationConnection!
  430. # The list of resources that are either published or staged to be published to a publication.
  431. resourcePublicationsV2(
  432. onlyPublished: Boolean = true
  433. first: Int
  434. after: String
  435. last: Int
  436. before: String
  437. reverse: Boolean = false
  438. ): ResourcePublicationV2Connection!
  439. # For a smart (automated) collection, specifies the rules that determine whether a product is included.
  440. ruleSet: CollectionRuleSet
  441. # If the default SEO fields for page title and description have been modified, contains the modified information.
  442. seo: SEO!
  443. # The order in which the products in the collection are displayed by default in the Shopify admin and in sales channels, such as an online store.
  444. sortOrder: CollectionSortOrder!
  445. # The suffix of the Liquid template being used to show the collection in an online store. For example, if the value is custom, then the collection is using the collection.custom.liquid template. If the value is null, then the collection is using the default collection.liquid template.
  446. templateSuffix: String
  447. # The name of the collection. It's displayed in the Shopify admin and is typically displayed in sales channels, such as an online store.
  448. title: String!
  449. # The translations associated with the resource.
  450. translations(locale: String!marketId: ID): [PublishedTranslation!]!
  451. # The list of publications that the resource is not published to.
  452. unpublishedPublications(
  453. first: Int
  454. after: String
  455. last: Int
  456. before: String
  457. reverse: Boolean = false
  458. ): PublicationConnection!
  459. # The date and time (ISO 8601 format) when the collection was last modified.
  460. updatedAt: DateTime!
  461. }
  462. # Properties used by customers to select a product variant.
  463. # Products can have multiple options, like different sizes or colors.
  464. type SelectedOption {
  465. # The product option’s name.
  466. name: String!
  467. # The product option’s value.
  468. value: String!
  469. }
  470. # The price of a product variant in a specific country.
  471. # Prices vary between countries.
  472. type ProductVariantContextualPricing {
  473. # The final compare-at price after all adjustments are applied.
  474. compareAtPrice: MoneyV2
  475. # The final price after all adjustments are applied.
  476. price: MoneyV2!
  477. }
  478. # The context data that determines the pricing of a variant.
  479. input ContextualPricingContext {
  480. # The country code used to fetch country-specific prices.
  481. country: CountryCode
  482. # The CompanyLocation ID used to fetch company location specific prices.
  483. companyLocationId: ID
  484. }
  485. # The set of rules that are used to determine which products are included in the collection.
  486. type CollectionRuleSet {
  487. # Whether products must match any or all of the rules to be included in the collection.
  488. # If true, then products must match at least one of the rules to be included in the collection.
  489. # If false, then products must match all of the rules to be included in the collection.
  490. appliedDisjunctively: Boolean!
  491. # The rules used to assign products to the collection.
  492. rules: [CollectionRule!]!
  493. }
  494. # The set of rules that are used to determine which products are included in the collection.
  495. type CollectionRule {
  496. # Whether products must match any or all of the rules to be included in the collection.
  497. # If true, then products must match at least one of the rules to be included in the collection.
  498. # If false, then products must match all of the rules to be included in the collection.
  499. appliedDisjunctively: Boolean!
  500. # The rules used to assign products to the collection.
  501. rules: [CollectionRule!]!
  502. }
  503. # The price of a product in a specific country.
  504. # Prices vary between countries.
  505. type ProductContextualPricing {
  506. # The pricing of the variant with the highest price in the given context.
  507. maxVariantPricing: ProductVariantContextualPricing
  508. # The pricing of the variant with the lowest price in the given context.
  509. minVariantPricing: ProductVariantContextualPricing
  510. # The price range of the product with prices formatted as decimals.
  511. priceRange: ProductPriceRangeV2!
  512. }
  513. # The price range of the product.
  514. type ProductPriceRangeV2 {
  515. # The highest variant's price.
  516. maxVariantPrice: MoneyV2!
  517. # The lowest variant's price.
  518. minVariantPrice: MoneyV2!
  519. }
  520. # Represents a Shopify product taxonomy node.
  521. type ProductTaxonomyNode implements Node {
  522. # The full name of the product taxonomy node.
  523. # For example, Animals & Pet Supplies > Pet Supplies > Dog Supplies > Dog Beds.
  524. fullName: String!
  525. # The ID of the product taxonomy node.
  526. id: ID!
  527. # Whether the node is a leaf node.
  528. isLeaf: Boolean!
  529. # Whether the node is a root node.
  530. isRoot: Boolean!
  531. # The name of the product taxonomy node. For example, Dog Beds.
  532. name: String!
  533. }