From edfe025d7777c414d4b1ba504c1016262f29aa54 Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Wed, 9 Oct 2024 09:46:14 -0700 Subject: [PATCH 01/13] updateSharedProductOptions --- .../graphql-admin/product-variant-options.mdx | 294 ++++++++++-------- 1 file changed, 156 insertions(+), 138 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx index afec75a52..fb22ab5a6 100644 --- a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx @@ -450,11 +450,7 @@ The following example removes product variant option information for the locale You can set information about a shared variant option for a store or a locale within a storefront channel. You must first create the shared variant options through the control panel. Changing a shared variant option affects all products that you assign to the shared variant option. You cannot customize shared variant options on a product level. -The following mutations let you set the name and values for existing shared variant options. - -### Set shared variant options at the global level - -The following example sets global shared variant option information for the store, from which channels inherit by default. You can set the name and values for existing variant options. +The following mutation sets the name and values for an existing shared variant option. @@ -465,11 +461,34 @@ The following example sets global shared variant option information for the stor Content-Type: application/json Accept: application/json - mutation ($input: SetSharedProductOptionsInformationInput!) { + mutation ($input: UpdateSharedProductOptionsInput!) { sharedProductOptions { - setSharedProductOptionsInformation (input: $input) { + updateSharedProductOptions(input: $input) { sharedProductOptions { id + displayName + values { + id + isDefault + label + } + overrides(context: { channelId: "bc/store/channel/1", locale: "fr" }) { + edges { + node { + ... on SharedProductOptionOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } + } + } } } } @@ -478,46 +497,90 @@ The following example sets global shared variant option information for the stor ```json filename="GraphQL variables" showLineNumbers copy { "input": { - "data": { - "options": [ - { - "optionId": "bc/store/sharedProductOption/1", - "data": { - "dropdown": { - "displayName": "Fabric", - "values": [ - { - "valueId": "bc/store/sharedProductOptionValue/123", - "label": "Cotton" - }, - { - "valueId": "bc/store/sharedProductOptionValue/124", - "label": "Polyester" + "data": [ + { + "optionId": "bc/store/sharedProductOption/1", + "optionData": { + "dropdown": { + "displayName": "Fabric", + "values": [ + { + "valueId": "bc/store/sharedProductOptionValue/123", + "label": "Cotton" + }, + { + "valueId": "bc/store/sharedProductOptionValue/124", + "label": "Polyester" + } + ], + "overrides": [ + { + "channelLocaleOverrides": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "data": { + "displayName": "Fabric channel override", + "values": [ + { + "valueId": "bc/store/sharedProductOptionValue/123", + "label": "Cotton channel override" + }, + { + "valueId": "bc/store/sharedProductOptionValue/124", + "label": "Polyester channel override" + } + ] + } } - ] - } + } + ] } - }, - { - "optionId": "bc/store/sharedProductOption/4", - "data": { - "swatch": { - "displayName": "Zipper color", - "values": [ - { - "valueId": "bc/store/sharedProductOptionValue/129", - "label": "Orange" - }, - { - "valueId": "bc/store/sharedProductOptionValue/130", - "label": "Green" + } + }, + { + "optionId": "bc/store/sharedProductOption/4", + "optionData": { + "swatch": { + "displayName": "Zipper color", + "values": [ + { + "valueId": "bc/store/sharedProductOptionValue/129", + "label": "Orange" + }, + { + "valueId": "bc/store/sharedProductOptionValue/130", + "label": "Green" + } + ], + "overrides": [ + { + "channelLocaleOverrides": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "data": { + "displayName": "Zipper color override", + "values": [ + { + "valueId": "bc/store/sharedProductOptionValue/129", + "label": "Orange override" + }, + { + "valueId": "bc/store/sharedProductOptionValue/130", + "label": "Green override" + } + ] + } } - ] - } + } + ] } } - ] - } + } + ] } } ``` @@ -529,113 +592,68 @@ The following example sets global shared variant option information for the stor { "data": { "sharedProductOptions": { - "setSharedProductOptionsInformation": { + "updateSharedProductOptions": { "sharedProductOptions": [ { - "id": "bc/store/sharedProductOption/1" - }, - { - "id": "bc/store/sharedProductOption/4" - } - ] - } - } - } - } - ``` - - - - -### Set shared variant options for a locale - -The following example sets shared variant option information for the locale within the specified storefront channel. These override global store information. You can set the name and values for existing variant options. - - - - - ```graphql filename="Example mutation: Set shared variant options for a locale" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - mutation ($input: SetSharedProductOptionsInformationInput!) { - sharedProductOptions { - setSharedProductOptionsInformation (input: $input) { - sharedProductOptions { - id - } - } - } - } - ``` - ```json filename="GraphQL variables" showLineNumbers copy - { - "input": { - "localeContext": { - "channelId": "bc/store/channel/2", - "locale": "uk" - }, - "data": { - "options": [ - { - "optionId": "bc/store/sharedProductOption/1", - "data": { - "dropdown": { - "displayName": "Fabric material", - "values": [ - { - "valueId": "bc/store/sharedProductOptionValue/123", - "label": "Linen" - }, + "id": "bc/store/sharedProductOption/1", + "displayName": "Fabric", + "values": [ + { + "id": "bc/store/sharedProductOptionValue/1", + "isDefault": true, + "label": "Cotton" + }, + { + "id": "bc/store/sharedProductOptionValue/2", + "isDefault": false, + "label": "Polyester" + } + ], + "overrides": { + "edges": [ { - "valueId": "bc/store/sharedProductOptionValue/124", - "label": "Nylon" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": "Fabric channel override", + "values": [] + } } ] } - } - }, - { - "optionId": "bc/store/sharedProductOption/4", - "data": { - "swatch": { - "displayName": "Color of zipper", - "values": [ - { - "valueId": "bc/store/sharedProductOptionValue/129", - "label": "Black" - }, + }, + { + "id": "bc/store/sharedProductOption/4", + "displayName": "Zipper color", + "values": [ + { + "id": "bc/store/sharedProductOptionValue/7", + "isDefault": false, + "label": "Orange" + }, + { + "id": "bc/store/sharedProductOptionValue/8", + "isDefault": true, + "label": "Green" + } + ], + "overrides": { + "edges": [ { - "valueId": "bc/store/sharedProductOptionValue/130", - "label": "Brown" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": "Zipper color override", + "values": [] + } } ] } } - } - ] - } - } - } - ``` - - - - - ```json filename="Example mutation: Set shared variant options for a locale" showLineNumbers copy - { - "data": { - "sharedProductOptions": { - "setSharedProductOptionsInformation": { - "sharedProductOptions": [ - { - "id": "bc/store/sharedProductOption/1" - }, - { - "id": "bc/store/sharedProductOption/4" - } ] } } From df1fe6a128746b97516a228cf936361aaeb80fc0 Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Wed, 9 Oct 2024 09:51:15 -0700 Subject: [PATCH 02/13] fix heading structure --- .../catalog/graphql-admin/product-variant-options.mdx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx index fb22ab5a6..4cf300427 100644 --- a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx @@ -11,10 +11,10 @@ Using the Catalog features of the Admin API, you can set and query information a Perform the following for product variant options: - [Set global variant option information](#set-variant-options-at-the-global-level) for the catalog. Channels inherit global information by default. -- [Create overrides for a channel locale](#set-variant-options-for-a-locale) using the `overridesForLocale` field. These override global store information. +- [Create overrides for a channel locale](#set-variant-options-for-a-locale). These override global store information. - [Remove overrides for a channel locale](#remove-variant-options-for-a-locale) -You can also set and remove information for [shared variant options](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#svo). The changes affect all products that you assign to the shared variant option. [Querying variant options](#query-product-variant-options) returns all variant options, including shared ones. +You can also set and remove information for [shared variant options](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#svo). Changing a shared variant option affects all products that you assign to the shared variant option. You cannot customize shared variant options on a product level. [Querying variant options](#query-product-variant-options) returns all variant options, including shared ones. For a full schema, see the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference). @@ -446,9 +446,11 @@ The following example removes product variant option information for the locale -## Set shared variant options +## Shared variant options -You can set information about a shared variant option for a store or a locale within a storefront channel. You must first create the shared variant options through the control panel. Changing a shared variant option affects all products that you assign to the shared variant option. You cannot customize shared variant options on a product level. +### Set shared variant options + +You can set information about a shared variant option for a store or a locale within a storefront channel. You must first create the shared variant options through the control panel. The following mutation sets the name and values for an existing shared variant option. From 12bf9379c37e3fae245d2df4ce0cf84d0013ed87 Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Wed, 9 Oct 2024 12:12:10 -0700 Subject: [PATCH 03/13] updateProductOptions --- .../graphql-admin/product-variant-options.mdx | 251 +++++------------- 1 file changed, 62 insertions(+), 189 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx index 4cf300427..d79a17c5c 100644 --- a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx @@ -10,8 +10,7 @@ Using the Catalog features of the Admin API, you can set and query information about a [product variant option](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#variations), such as option name and values. Perform the following for product variant options: -- [Set global variant option information](#set-variant-options-at-the-global-level) for the catalog. Channels inherit global information by default. -- [Create overrides for a channel locale](#set-variant-options-for-a-locale). These override global store information. +- [Set variant options](#set-variant-options): You can set global variant option information for the catalog. Channels inherit global information by default. You can also create overrides for a channel locale. These override global store information. - [Remove overrides for a channel locale](#remove-variant-options-for-a-locale) You can also set and remove information for [shared variant options](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#svo). Changing a shared variant option affects all products that you assign to the shared variant option. You cannot customize shared variant options on a product level. [Querying variant options](#query-product-variant-options) returns all variant options, including shared ones. @@ -22,7 +21,7 @@ For a full schema, see the [GraphQL Admin API reference](https://developer.bigco Setting or removing information requires that you specify ID fields in the input. For more information on how to specify ID fields, see [Input fields](/docs/store-operations/catalog/msf-international-enhancements#input-fields). -## Set variant options +## Variant options Set information about a product variant option for a store or a locale within a storefront channel. @@ -32,25 +31,25 @@ The following mutations let you set the name and values for existing variant opt The responses may include all variant options, including those that are shared. However, to _set_ shared variant options, use the mutations in [Set shared variant options](#set-shared-variant-options). -### Set variant options at the global level +### Set variant options -The following example sets the store's global product variant option information, from which channels inherit by default. You can set the name and values for existing variant options. +The following example sets product variant option information. - ```graphql filename="Example mutation: Set product variant options at the global level" showLineNumbers copy + ```graphql filename="Example mutation: Set product variant options" showLineNumbers copy POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql X-Auth-Token: {{ACCESS_TOKEN}} Content-Type: application/json Accept: application/json - mutation ($input: SetProductOptionsInformationInput!) { + mutation ($input: UpdateProductOptionsInput!) { product { - setProductOptionsInformation (input: $input) { + updateProductOptions(input: $input) { product { id - options (first: 2) { + options(first: 2) { edges { node { id @@ -72,32 +71,57 @@ The following example sets the store's global product variant option information { "input": { "productId": "bc/store/product/111", - "data": { - "options": [ - { - "optionId": "bc/store/productOption/108", - "data": { - "dropdown": { - "displayName": "Size US", - "values": [ - { - "valueId": "bc/store/productOptionValue/68", - "label": "Small US" - }, - { - "valueId": "bc/store/productOptionValue/69", - "label": "Medium US" - }, - { - "valueId": "bc/store/productOptionValue/70", - "label": "Large US" + "data": [ + { + "optionId": "bc/store/productOption/108", + "optionData": { + "dropdown": { + "displayName": "Size UK", + "values": [ + { + "valueId": "bc/store/productOptionValue/68", + "label": "Small UK" + }, + { + "valueId": "bc/store/productOptionValue/69", + "label": "Medium UK" + }, + { + "valueId": "bc/store/productOptionValue/70", + "label": "Large UK" + } + ], + "overrides": [ + { + "channelLocaleOverrides": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "data": { + "displayName": "Override Size UK", + "values": [ + { + "valueId": "bc/store/productOptionValue/68", + "label": "Override Small UK" + }, + { + "valueId": "bc/store/productOptionValue/69", + "label": "Override Medium UK" + }, + { + "valueId": "bc/store/productOptionValue/70", + "label": "Override Large UK" + } + ] + } } - ] - } + } + ] } } - ] - } + } + ] } } ``` @@ -105,11 +129,11 @@ The following example sets the store's global product variant option information - ```json filename="Example mutation: Set product variant options at the global level" showLineNumbers copy + ```json filename="Example mutation: Set product variant options" showLineNumbers copy { "data": { "product": { - "setProductOptionsInformation": { + "updateProductOptions": { "product": { "id": "bc/store/product/111", "options": { @@ -117,37 +141,20 @@ The following example sets the store's global product variant option information { "node": { "id": "bc/store/productOption/108", - "displayName": "Size US", + "displayName": "Size UK", "isShared": false, "values": [ { "id": "bc/store/productOptionValue/68", - "label": "Small US" + "label": "Small UK" }, { "id": "bc/store/productOptionValue/69", - "label": "Medium US" + "label": "Medium UK" }, { "id": "bc/store/productOptionValue/70", - "label": "Large US" - } - ] - } - }, - { - "node": { - "id": "bc/store/productOption/109", - "displayName": "Color", - "isShared": false, - "values": [ - { - "id": "bc/store/productOptionValue/7", - "label": "Silver" - }, - { - "id": "bc/store/productOptionValue/8", - "label": "Black" + "label": "Large UK" } ] } @@ -164,140 +171,6 @@ The following example sets the store's global product variant option information -### Set variant options for a locale - -The following example sets product variant option information for the locale within the specified storefront channel. These override global store information. You can set the name and values for existing variant options. - - - - - ```graphql filename="Example mutation: Set product variant options for a locale" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - mutation ($input: SetProductOptionsInformationInput!) { - product { - setProductOptionsInformation (input: $input) { - product { - id - options (first: 2) { - edges { - node { - id - overridesForLocale( - localeContext: { - channelId: "bc/store/channel/2", - locale: "uk" - } - ) { - displayName - values { - id - label - } - } - } - } - } - } - } - } - } - ``` - ```json filename="GraphQL variables" showLineNumbers copy - { - "input": { - "productId": "bc/store/product/111", - "localeContext": { - "channelId": "bc/store/channel/2", - "locale": "uk" - }, - "data": { - "options": [ - { - "optionId": "bc/store/productOption/108", - "data": { - "dropdown": { - "displayName": "Size UK", - "values": [ - { - "valueId": "bc/store/productOptionValue/68", - "label": "Small UK" - }, - { - "valueId": "bc/store/productOptionValue/69", - "label": "Medium UK" - }, - { - "valueId": "bc/store/productOptionValue/70", - "label": "Large UK" - } - ] - } - } - } - ] - } - } - } - ``` - - - - - ```json filename="Example mutation: Set product variant options for a locale" showLineNumbers copy - { - "data": { - "product": { - "setProductOptionsInformation": { - "product": { - "id": "bc/store/product/111", - "options": { - "edges": [ - { - "node": { - "id": "bc/store/productOption/108", - "overridesForLocale": { - "displayName": "Size UK", - "values": [ - { - "id": "bc/store/productOptionValue/68", - "label": "Small UK" - }, - { - "id": "bc/store/productOptionValue/69", - "label": "Medium UK" - }, - { - "id": "bc/store/productOptionValue/70", - "label": "Large UK" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productOption/109", - "overridesForLocale": { - "displayName": null, - "values": [] - } - } - } - ] - } - } - } - } - } - } - ``` - - - ### Remove variant options for a locale From 654dd32257a879f2a17e95ae9503510323851576 Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Wed, 9 Oct 2024 12:13:54 -0700 Subject: [PATCH 04/13] edit example name --- .../catalog/graphql-admin/product-variant-options.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx index d79a17c5c..77c7d7e1a 100644 --- a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx @@ -330,7 +330,7 @@ The following mutation sets the name and values for an existing shared variant o - ```graphql filename="Example mutation: Set shared variant options at the global level" showLineNumbers copy + ```graphql filename="Example mutation: Set shared variant options" showLineNumbers copy POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql X-Auth-Token: {{ACCESS_TOKEN}} Content-Type: application/json @@ -463,7 +463,7 @@ The following mutation sets the name and values for an existing shared variant o - ```json filename="Example mutation: Set shared variant options at the global level" showLineNumbers copy + ```json filename="Example mutation: Set shared variant options" showLineNumbers copy { "data": { "sharedProductOptions": { From 20c854c381ca775ac48747e85ed7215e8449723b Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Wed, 9 Oct 2024 13:39:26 -0700 Subject: [PATCH 05/13] query for product modifier / shared product modifier --- .../product-modifier-options.mdx | 411 ++++-------------- 1 file changed, 89 insertions(+), 322 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx b/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx index 914e724f0..e79d81471 100644 --- a/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx @@ -963,9 +963,9 @@ The following example retrieves modifier information. You can retrieve global in query { store { - product (id: "bc/store/product/111") { + product(id: "bc/store/product/111") { id - modifiers (first: 10) { + modifiers(first: 10) { edges { node { __typename @@ -973,108 +973,62 @@ The following example retrieves modifier information. You can retrieve global in displayName isShared isRequired - ... on CheckboxProductModifier { - checkedByDefault - fieldValue - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - fieldValue - } - } - ... on TextFieldProductModifier { - defaultValue - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - defaultValue - } - } - ... on MultilineTextFieldProductModifier { - defaultValue - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - defaultValue - } - } - ... on NumbersOnlyTextFieldProductModifier { - defaultValueFloat: defaultValue - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - defaultValueFloat: defaultValue - } - } + ... on DropdownProductModifier { values { id label isDefault } - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label + overrides(context: { channelId: "bc/store/channel/2", locale: "fr" }) { + edges { + node { + ... on DropdownProductModifierOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } } - } - } - ... on RadioButtonsProductModifier { - values { - id - label - isDefault - } - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label - } - } - } - ... on RectangleListProductModifier { - values { - id - label - isDefault - } - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label } } } + ... on SwatchProductModifier { values { id label isDefault } - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label + overrides(context: { channelId: "bc/store/channel/2", locale: "fr" }) { + edges { + node { + ... on SwatchProductModifierOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } } } } - ... on FileUploadProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - } - } - ... on DateFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - } - } } } } } } } - ``` @@ -1093,13 +1047,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/118", "displayName": "Include Insurance?", "isShared": false, - "isRequired": true, - "checkedByDefault": true, - "fieldValue": "Yes", - "overridesForLocale": { - "displayName": null, - "fieldValue": null - } + "isRequired": true } }, { @@ -1108,12 +1056,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/119", "displayName": "Custom Message", "isShared": false, - "isRequired": false, - "defaultValue": "Enjoy your gift", - "overridesForLocale": { - "displayName": null, - "fieldValue": null - } + "isRequired": false } }, { @@ -1122,32 +1065,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/121", "displayName": "Holiday Theme", "isShared": false, - "isRequired": false, - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Birthday", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Christmas", - "isDefault": true - } - ], - "overridesForLocale": { - "displayName": "Thème de vacances", - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Anniversaire" - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Noël" - } - ] - } + "isRequired": false } }, { @@ -1169,16 +1087,26 @@ The following example retrieves modifier information. You can retrieve global in "isDefault": false } ], - "overridesForLocale": { - "displayName": "Couleur du capot", - "values": [ - { - "id": "bc/store/productModifierValue/115", - "label": "Rouge" - }, + "overrides": { + "edges": [ { - "id": "bc/store/productModifierValue/116", - "label": "Bleu" + "node": { + "context": { + "channelId": "bc/store/channel/2", + "locale": "fr" + }, + "displayName": "Couleur du capot", + "values": [ + { + "id": "bc/store/productModifierValue/115", + "label": "Rouge" + }, + { + "id": "bc/store/productModifierValue/116", + "label": "Bleu" + } + ] + } } ] } @@ -1186,41 +1114,16 @@ The following example retrieves modifier information. You can retrieve global in }, { "node": { - "__typename": "RectangleListProductModifier", + "__typename": "RadioButtonsProductModifier", "id": "bc/store/productModifier/123", "displayName": "Pattern", "isShared": false, - "isRequired": false, - "values": [ - { - "id": "bc/store/productModifierValue/117", - "label": "Plain", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/118", - "label": "Checkered", - "isDefault": true - } - ], - "overridesForLocale": { - "displayName": "Modèle", - "values": [ - { - "id": "bc/store/productModifierValue/117", - "label": "ordinaire" - }, - { - "id": "bc/store/productModifierValue/118", - "label": "à carreaux" - } - ] - } + "isRequired": false } }, { "node": { - "__typename": "RectangleListProductModifier", + "__typename": "DropdownProductModifier", "id": "bc/store/productModifier/124", "displayName": "Fit Type", "isShared": false, @@ -1237,16 +1140,26 @@ The following example retrieves modifier information. You can retrieve global in "isDefault": false } ], - "overridesForLocale": { - "displayName": "Type d'ajustement", - "values": [ + "overrides": { + "edges": [ { - "id": "bc/store/productModifierValue/119", - "label": "Régulière" - }, - { - "id": "bc/store/productModifierValue/120", - "label": "Ample" + "node": { + "context": { + "channelId": "bc/store/channel/2", + "locale": "fr" + }, + "displayName": "Type d'ajustement", + "values": [ + { + "id": "bc/store/productModifierValue/119", + "label": "Régulière" + }, + { + "id": "bc/store/productModifierValue/120", + "label": "Ample" + } + ] + } } ] } @@ -1258,12 +1171,16 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/125", "displayName": "Optional details", "isShared": false, - "isRequired": false, - "defaultValue": "", - "overridesForLocale": { - "displayName": null, - "fieldValue": null - } + "isRequired": false + } + }, + { + "node": { + "__typename": "PickListProductModifier", + "id": "bc/store/productModifier/126", + "displayName": "Closure Type", + "isShared": false, + "isRequired": false } }, { @@ -1272,12 +1189,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/127", "displayName": "Number of Pockets", "isShared": false, - "isRequired": true, - "defaultValueFloat": 1, - "overridesForLocale": { - "displayName": null, - "defaultValueFloat": null - } + "isRequired": true } }, { @@ -1286,152 +1198,7 @@ The following example retrieves modifier information. You can retrieve global in "id": "bc/store/productModifier/128", "displayName": "Anniversary Date", "isShared": false, - "isRequired": false, - "overridesForLocale": { - "displayName": "Date d'anniversaire" - } - } - }, - { - "node": { - "__typename": "FileUploadProductModifier", - "id": "bc/store/productModifier/129", - "displayName": "Custom-printed Image", - "isShared": false, - "isRequired": false, - "overridesForLocale": { - "displayName": "image personnalisée" - } - } - } - ] - } - } - } - } - } - ``` - - - - - -You can retrieve overrides for multiple locales in a channel, as shown in the following example: - - - - - ```graphql filename="Example query: Get modifier options" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - query { - store { - product (id: "bc/store/product/111") { - id - modifiers (first: 1) { - edges { - node { - __typename - id - displayName - isShared - isRequired - - // modifier values for rectangle List product modifiers - ... on RectangleListProductModifier { - - // global values for the store - values { - id - label - isDefault - } - - // overrides for the UK locale in channel 2 - uk: overridesForLocale(localeContext: { channelId: "bc/store/channel/2", locale: "uk" }) { - displayName - values { - id - label - } - } - - // overrides for the France locale in channel 2 - fr: overridesForLocale(localeContext: { channelId: "bc/store/channel/2", locale: "fr" }) { - displayName - values { - id - label - } - } - } - } - } - } - } - } - } - ``` - - - - - ```json filename="Example query: Get modifier options" showLineNumbers copy - { - "data": { - "store": { - "product": { - "id": "bc/store/product/111", - "modifiers": { - "edges": [ - { - "node": { - "__typename": "RectangleListProductModifier", - "id": "bc/store/productModifier/121", - "displayName": "Holiday Theme", - "isShared": false, - "isRequired": false, - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Birthday", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Christmas", - "isDefault": true - } - ], - "uk": { - "displayName": "Public Holiday", - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "New Year's Day" - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Chrimbo" - } - ] - }, - "fr": { - "displayName": "Thème de vacances", - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Anniversaire" - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Noël" - } - ] - } + "isRequired": false } } ] From 644f7081156016acb128f16f1c4def0388106a6a Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Wed, 9 Oct 2024 14:52:34 -0700 Subject: [PATCH 06/13] product modifier & shared product modifier --- .../product-modifier-options.mdx | 585 +++--------------- 1 file changed, 78 insertions(+), 507 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx b/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx index e79d81471..43e4f5112 100644 --- a/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx @@ -10,12 +10,13 @@ Using the Catalog features of the Admin API, you can set and query information about a product modifier options, for example, option name and values. You can perform the following: -- [Set global modifier option information](#set-product-modifier-options-at-the-global-level) for the catalog. Channels inherit these by default. -- [Create overrides for a channel locale](#set-product-modifier-options-for-a-locale) using the `overridesForLocale` mutation. -- [Remove overrides for a channel locale](#remove-product-modifier-options-for-a-locale) +- [Set modifier option information](#set-product-modifier-options): You can set global modifier information for the catalog. Channels inherit global information by default. You can also create overrides for a channel locale using the `overridesForLocale` mutation. These override global store information. +- [Remove overrides for a channel locale](#remove-product-modifier-options-for-a-locale). - [Query modifier option information](#query-modifier-options), those set at the global level and the overrides. -You can also set and remove information for [shared modifiers](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#smo). The changes affect all products that you assign to the shared modifier. [Querying modifier options](#query-modifier-options) returns all modifiers, including shared ones. +You can also set and remove information for [shared modifiers](https://support.bigcommerce.com/s/article/Product-Options-v3?language=en_US#smo). Changing a shared modifier option affects all products that you assign to the shared modifier option. You cannot customize shared modifier options on a product level. + +[Querying modifier options](#query-modifier-options) returns all modifiers, including shared ones. For a full schema, see the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference). @@ -23,24 +24,22 @@ For a full schema, see the [GraphQL Admin API reference](https://developer.bigco Setting or removing information requires that you specify ID fields in the input. For more information on how to specify ID fields, see [Input fields](/docs/store-operations/catalog/msf-international-enhancements#input-fields). -## Set product modifier options - -Set information about a product modifier option for a store or a locale within a storefront channel. +## Product modifier options -The following mutations let you set the name and values for existing modifier options. You must first create the modifier option for the product through the control panel or the REST [Create a product modifier](/docs/rest-catalog/product-modifiers#create-a-product-modifier) endpoint. +Set information about a product modifier option for a store or a locale within a storefront channel. You must first create the modifier option for the product through the control panel or the REST [Create a product modifier](/docs/rest-catalog/product-modifiers#create-a-product-modifier) endpoint. The responses may include all modifier options, including those that are shared. However, to _set_ shared modifier options, use the mutations in [Set shared modifier options](#set-shared-modifier-options). -### Set product modifier options at the global level +### Set product modifier options -The following example sets global product modifier information for the store, from which channels inherit by default. You can set the modifier name and values. +The following mutation lets you sets information for a channel locale. To set information for the global store, don't include the `localeContext` field in the `input`. - ```graphql filename="Example mutation: Set product modifier options at the global level" showLineNumbers copy + ```graphql filename="Example mutation: Set product modifier options for a channel locale" showLineNumbers copy POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql X-Auth-Token: {{ACCESS_TOKEN}} Content-Type: application/json @@ -48,7 +47,7 @@ The following example sets global product modifier information for the store, fr mutation ($input: SetProductModifiersInformationInput!) { product { - setProductModifiersInformation (input: $input) { + setProductModifiersInformation(input: $input) { product { id modifiers { @@ -56,47 +55,24 @@ The following example sets global product modifier information for the store, fr node { id displayName - isRequired - isShared - ... on CheckboxProductModifier { - checkedByDefault - fieldValue - } - ... on TextFieldProductModifier { - defaultValue - } - ... on MultilineTextFieldProductModifier { - defaultValue - } - ... on NumbersOnlyTextFieldProductModifier { - defaultValueFloat: defaultValue - } - ... on DropdownProductModifier { - values { - id - label - isDefault - } - } - ... on RadioButtonsProductModifier { - values { - id - label - isDefault - } - } + ... on RectangleListProductModifier { - values { - id - label - isDefault - } - } - ... on SwatchProductModifier { - values { - id - label - isDefault + overrides(context: { channelId: "bc/store/channel/2", locale: "fr" }) { + edges { + node { + ... on RectangleListProductModifierOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } + } } } } @@ -112,21 +88,25 @@ The following example sets global product modifier information for the store, fr { "input": { "productId": "bc/store/product/111", + "localeContext": { + "channelId": "bc/store/channel/2", + "locale": "fr" + }, "data": { "modifiers": [ { "modifierId": "bc/store/productModifier/121", "data": { "rectangleList": { - "displayName": "Holiday Theme", + "displayName": "Thème de vacances", "values": [ { "valueId": "bc/store/productModifierValue/113", - "label": "Birthday" + "label": "Anniversaire" }, { "valueId": "bc/store/productModifierValue/114", - "label": "Christmas" + "label": "Noël" } ] } @@ -141,7 +121,7 @@ The following example sets global product modifier information for the store, fr - ```json filename="Example mutation: Set product modifier options at the global level" showLineNumbers copy + ```json filename="Example mutation: Set product modifier options for a channel locale" showLineNumbers copy { "data": { "product": { @@ -153,134 +133,84 @@ The following example sets global product modifier information for the store, fr { "node": { "id": "bc/store/productModifier/118", - "displayName": "Include Insurance?", - "isRequired": true, - "isShared": false, - "checkedByDefault": true, - "fieldValue": "Yes" + "displayName": "Include Insurance?" } }, { "node": { "id": "bc/store/productModifier/119", - "displayName": "Custom Message", - "isRequired": false, - "isShared": false, - "defaultValue": "Enjoy your gift" + "displayName": "Custom Message" } }, { "node": { "id": "bc/store/productModifier/121", "displayName": "Holiday Theme", - "isRequired": false, - "isShared": false, - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Birthday", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Christmas", - "isDefault": true - } - ] + "overrides": { + "edges": [ + { + "node": { + "context": { + "channelId": "bc/store/channel/2", + "locale": "fr" + }, + "displayName": "Thème de vacances", + "values": [ + { + "id": "bc/store/productModifierValue/113", + "label": "Anniversaire" + }, + { + "id": "bc/store/productModifierValue/114", + "label": "Noël" + } + ] + } + } + ] + } } }, { "node": { "id": "bc/store/productModifier/122", - "displayName": "Hood Color", - "isRequired": true, - "isShared": false, - "values": [ - { - "id": "bc/store/productModifierValue/115", - "label": "Red Hood", - "isDefault": false - }, - { - "id": "bc/store/productModifierValue/116", - "label": "Blue Hood", - "isDefault": false - } - ] + "displayName": "Hood Color" } }, { "node": { "id": "bc/store/productModifier/123", - "displayName": "Pattern", - "isRequired": false, - "isShared": false, - "values": [ - { - "id": "bc/store/productModifierValue/117", - "label": "Plain", - "isDefault": true - }, - { - "id": "bc/store/productModifierValue/118", - "label": "Checkered", - "isDefault": true - } - ] + "displayName": "Pattern" } }, { "node": { "id": "bc/store/productModifier/124", - "displayName": "Fit Type", - "isRequired": false, - "isShared": false, - "values": [ - { - "id": "bc/store/productModifierValue/119", - "label": "Regular fit", - "isDefault": false - }, - { - "id": "bc/store/productModifierValue/120", - "label": "Loose fit", - "isDefault": false - } - ] + "displayName": "Fit Type" } }, { "node": { - "id": "bc/store/productModifier/125", - "displayName": "Optional details", - "isRequired": false, - "isShared": false, - "defaultValue": "" + "id": "bc/store/productModifier/125", + "displayName": "Optional details" } }, { "node": { - "id": "bc/store/productModifier/127", - "displayName": "Number of Pockets", - "isRequired": true, - "isShared": false, - "defaultValueFloat": 1 + "id": "bc/store/productModifier/126", + "displayName": "Closure Type" } }, { "node": { - "id": "bc/store/productModifier/128", - "displayName": "Anniversary Date", - "isRequired": false, - "isShared": false + "id": "bc/store/productModifier/127", + "displayName": "Number of Pockets" } }, { "node": { - "id": "bc/store/productModifier/129", - "displayName": "Custom-printed Image", - "isRequired": false, - "isShared": false + "id": "bc/store/productModifier/128", + "displayName": "Anniversary Date" } } ] @@ -295,288 +225,6 @@ The following example sets global product modifier information for the store, fr -### Set product modifier options for a locale - -The following example sets product modifier option information for the locale within the specified storefront channel. These will override global store information. You can set the modifier option name and values. - - - - - ```graphql filename="Example mutation: Set product modifier options for a locale" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - mutation ($input: SetProductModifiersInformationInput!) { - product { - setProductModifiersInformation (input: $input) { - product { - id - modifiers { - edges { - node { - id - displayName - ... on CheckboxProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - fieldValue - } - } - ... on TextFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - defaultValue - } - } - ... on MultilineTextFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - defaultValue - } - } - ... on NumbersOnlyTextFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - defaultValueFloat: defaultValue - } - } - ... on DropdownProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - values { - id - label - } - } - } - ... on RadioButtonsProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - values { - id - label - } - } - } - ... on RectangleListProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - values { - id - label - } - } - } - ... on SwatchProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - values { - id - label - } - } - } - ... on FileUploadProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - } - } - ... on DateFieldProductModifier { - overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "fr"}) { - displayName - } - } - } - } - } - } - } - } - } - ``` - - ```json filename="GraphQL variables" showLineNumbers copy - { - "input": { - "productId": "bc/store/product/111", - "localeContext": { - "channelId": "bc/store/channel/2", - "locale": "fr" - }, - "data": { - "modifiers": [ - { - "modifierId": "bc/store/productModifier/121", - "data": { - "rectangleList": { - "displayName": "Thème de vacances", - "values": [ - { - "valueId": "bc/store/productModifierValue/113", - "label": "Anniversaire" - }, - { - "valueId": "bc/store/productModifierValue/114", - "label": "Noël" - } - ] - } - } - } - ] - } - } - } - ``` - - - - - ```json filename="Example mutation: Set product modifier options for a locale" showLineNumbers copy - { - "data": { - "product": { - "setProductModifiersInformation": { - "product": { - "id": "bc/store/product/111", - "modifiers": { - "edges": [ - { - "node": { - "id": "bc/store/productModifier/118", - "displayName": "Include Insurance?", - "overridesForLocale": null - } - }, - { - "node": { - "id": "bc/store/productModifier/119", - "displayName": "Custom Message", - "overridesForLocale": null - } - }, - { - "node": { - "id": "bc/store/productModifier/121", - "displayName": "Holiday Theme", - "overridesForLocale": { - "displayName": "Thème de vacances", - "values": [ - { - "id": "bc/store/productModifierValue/113", - "label": "Anniversaire" - }, - { - "id": "bc/store/productModifierValue/114", - "label": "Noël" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productModifier/122", - "displayName": "Hood Color", - "overridesForLocale": { - "displayName": "Couleur du capot", - "values": [ - { - "id": "bc/store/productModifierValue/115", - "label": "Rouge" - }, - { - "id": "bc/store/productModifierValue/116", - "label": "Bleu" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productModifier/123", - "displayName": "Pattern", - "overridesForLocale": { - "displayName": "Modèle", - "values": [ - { - "id": "bc/store/productModifierValue/117", - "label": "Ordinaire" - }, - { - "id": "bc/store/productModifierValue/118", - "label": "A carreaux" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productModifier/124", - "displayName": "Fit Type", - "overridesForLocale": { - "displayName": "Type d'ajustement", - "values": [ - { - "id": "bc/store/productModifierValue/119", - "label": "Régulière" - }, - { - "id": "bc/store/productModifierValue/120", - "label": "Ample" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productModifier/125", - "displayName": "Optional details", - "overridesForLocale": null - } - }, - { - "node": { - "id": "bc/store/productModifier/127", - "displayName": "Number of Pockets", - "overridesForLocale": null - } - }, - { - "node": { - "id": "bc/store/productModifier/128", - "displayName": "Anniversary Date", - "overridesForLocale": { - "displayName": "Date d'anniversaire" - } - } - }, - { - "node": { - "id": "bc/store/productModifier/129", - "displayName": "Custom-printed Image", - "overridesForLocale": { - "displayName": "Image personnalisée" - } - } - } - ] - } - } - } - } - } - } - ``` - - - - ### Remove product modifier options for a locale The following example removes product modifier option information for the locale within the specified storefront channel. @@ -719,95 +367,18 @@ The following example removes product modifier option information for the locale -## Set shared modifier options - -You can set information about a shared modifier option for a store or a locale within a storefront channel. You must first create the shared modifier options through the control panel. Changing a shared modifier option affects all products that you assign to the shared modifier option. You cannot customize shared modifier options on a product level. - -The following mutations let you set the name and values for existing shared modifiers. - -### Set shared modifier options at the global level +## Shared modifier options -The following example sets global shared modifier information for the store, from which channels inherit by default. You can set the name and values for existing modifiers. - - - - - ```graphql filename="Example mutation: Set shared modifier options at the global level" showLineNumbers copy - POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql - X-Auth-Token: {{ACCESS_TOKEN}} - Content-Type: application/json - Accept: application/json - - mutation ($input: SetSharedProductModifiersInformationInput!) { - sharedProductModifiers { - setSharedProductModifiersInformation (input: $input) { - sharedProductModifiers { - id - } - } - } - } - ``` - - ```json filename="GraphQL variables" showLineNumbers copy - { - "input": { - "data": { - "modifiers": [ - { - "modifierId": "bc/store/sharedProductModifier/2", - "data": { - "rectangleList": { - "displayName": "Button type", - "values": [ - { - "valueId": "bc/store/sharedProductModifierValue/107", - "label": "Large buttons" - }, - { - "valueId": "bc/store/sharedProductModifierValue/108", - "label": "Small buttons" - } - ] - } - } - } - ] - } - } - } - ``` - - - - - ```json filename="Example mutation: Set shared modifier options at the global level" showLineNumbers copy - { - "data": { - "sharedProductModifiers": { - "setSharedProductModifiersInformation": { - "sharedProductModifiers": [ - { - "id": "bc/store/sharedProductModifier/2" - } - ] - } - } - } - } - ``` - - - +You can set information about a shared modifier option for a store or a locale within a storefront channel. You must first create the shared modifier options through the control panel. -### Set shared modifier options for a locale +### Set shared modifier options -The following example sets shared modifier information for the locale within the specified storefront channel. These override global store information. You can set the name and values for existing modifiers. +The following example sets shared modifier information for the locale within the specified storefront channel. To set global store values, don't include the `localeContext` field in the input. - ```graphql filename="Example mutation: Set shared modifier options for a locale" showLineNumbers copy + ```graphql filename="Example mutation: Set shared modifier options for a channel locale" showLineNumbers copy POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql X-Auth-Token: {{ACCESS_TOKEN}} Content-Type: application/json @@ -860,7 +431,7 @@ The following example sets shared modifier information for the locale within the - ```json filename="Example mutation: Set shared modifier options for a locale" showLineNumbers copy + ```json filename="Example mutation: Set shared modifier options for a channel locale" showLineNumbers copy { "data": { "sharedProductModifiers": { From a43b5b3d3545ec03d74a3f5ad622760e790316c2 Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Fri, 11 Oct 2024 15:46:45 -0700 Subject: [PATCH 07/13] update set product options to include override in response --- .../graphql-admin/product-variant-options.mdx | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx index 77c7d7e1a..367f4450f 100644 --- a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx @@ -33,7 +33,7 @@ The following mutations let you set the name and values for existing variant opt ### Set variant options -The following example sets product variant option information. +The following example sets product variant option information for the global store and a channel locale. @@ -49,7 +49,7 @@ The following example sets product variant option information. updateProductOptions(input: $input) { product { id - options(first: 2) { + options (first: 1) { edges { node { id @@ -59,6 +59,23 @@ The following example sets product variant option information. id label } + overrides(context: { channelId: "bc/store/channel/1", locale: "fr" }) { + edges { + node { + ... on ProductOptionOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } + } + } } } } @@ -156,7 +173,34 @@ The following example sets product variant option information. "id": "bc/store/productOptionValue/70", "label": "Large UK" } - ] + ], + "overrides": { + "edges": [ + { + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": "Override Size UK", + "values": [ + { + "id": "bc/store/productOptionValue/68", + "label": "Override Small UK" + }, + { + "id": "bc/store/productOptionValue/69", + "label": "Override Medium UK" + }, + { + "id": "bc/store/productOptionValue/70", + "label": "Override Large UK" + } + ] + } + } + ] + } } } ] From c1b3f6a2548f66d9ba1a726949581922eeaf9a3f Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Fri, 11 Oct 2024 16:10:21 -0700 Subject: [PATCH 08/13] change the mutation for removing product option for a locale --- .../graphql-admin/product-variant-options.mdx | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx index 367f4450f..d49d46c6f 100644 --- a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx @@ -231,10 +231,10 @@ The following example removes product variant option information for the locale mutation ($input: RemoveProductOptionsOverridesInput!) { product { - removeProductOptionsOverrides (input: $input) { + removeProductOptionsOverrides(input: $input) { product { id - options (first: 2) { + options (first: 1) { edges { node { id @@ -243,11 +243,21 @@ The following example removes product variant option information for the locale id label } - overridesForLocale (localeContext: {channelId: "bc/store/channel/2", locale: "uk"}) { - displayName - values { - id - label + overrides(context: { channelId: "bc/store/channel/1", locale: "fr" }) { + edges { + node { + ... on ProductOptionOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } } } } @@ -264,8 +274,8 @@ The following example removes product variant option information for the locale "input": { "productId": "bc/store/product/111", "localeContext": { - "channelId": "bc/store/channel/2", - "locale": "uk" + "channelId": "bc/store/channel/1", + "locale": "fr" }, "data": { "options": [ @@ -301,55 +311,45 @@ The following example removes product variant option information for the locale { "node": { "id": "bc/store/productOption/108", - "displayName": "Size US", + "displayName": "Size UK", "values": [ { "id": "bc/store/productOptionValue/68", - "label": "Small US" + "label": "Small UK" }, { "id": "bc/store/productOptionValue/69", - "label": "Medium US" + "label": "Medium UK" }, { "id": "bc/store/productOptionValue/70", - "label": "Large US" + "label": "Large UK" } ], - "overridesForLocale": { - "displayName": null, - "values": [ - { - "id": "bc/store/productOptionValue/68", - "label": "Small UK" - }, + "overrides": { + "edges": [ { - "id": "bc/store/productOptionValue/69", - "label": "Medium UK" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": null, + "values": [ + { + "id": "bc/store/productOptionValue/68", + "label": "Override Small UK" + }, + { + "id": "bc/store/productOptionValue/69", + "label": "Override Medium UK" + } + ] + } } ] } } - }, - { - "node": { - "id": "bc/store/productOption/109", - "displayName": "Color", - "values": [ - { - "id": "bc/store/productOptionValue/7", - "label": "Silver" - }, - { - "id": "bc/store/productOptionValue/8", - "label": "Black" - } - ], - "overridesForLocale": { - "displayName": null, - "values": [] - } - } } ] } From 35192bf6fe98f1ad43ac421a8fb311b0f6929a9e Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Fri, 11 Oct 2024 16:20:35 -0700 Subject: [PATCH 09/13] change query product options --- .../graphql-admin/product-variant-options.mdx | 121 +++++++----------- 1 file changed, 44 insertions(+), 77 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx index d49d46c6f..bb68db572 100644 --- a/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-variant-options.mdx @@ -672,7 +672,7 @@ The following example retrieves variant information. You can retrieve global inf store { product(id: "bc/store/product/111") { id - options (first: 3) { + options (first: 1) { edges { node { id @@ -683,13 +683,21 @@ The following example retrieves variant information. You can retrieve global inf label isDefault } - overridesForLocale( - localeContext: { channelId: "bc/store/channel/2", locale: "uk"} - ) { - displayName - values { - id - label + overrides(context: { channelId: "bc/store/channel/1", locale: "fr" }) { + edges { + node { + ... on ProductOptionOverridesForChannelLocale { + context { + channelId + locale + } + displayName + values { + id + label + } + } + } } } } @@ -697,7 +705,7 @@ The following example retrieves variant information. You can retrieve global inf } } } - } + } ``` @@ -713,90 +721,49 @@ The following example retrieves variant information. You can retrieve global inf { "node": { "id": "bc/store/productOption/108", - "displayName": "Size", + "displayName": "Size UK", "isShared": false, "values": [ { "id": "bc/store/productOptionValue/68", - "label": "Small US", + "label": "Small UK", "isDefault": false }, { "id": "bc/store/productOptionValue/69", - "label": "Medium US", + "label": "Medium UK", "isDefault": false }, { "id": "bc/store/productOptionValue/70", - "label": "Large US", - "isDefault": false - } - ], - "overridesForLocale": { - "displayName": "Size UK", - "values": [ - { - "id": "bc/store/productOptionValue/68", - "label": "Small UK" - }, - { - "id": "bc/store/productOptionValue/69", - "label": "Medium UK" - } - ] - } - } - }, - { - "node": { - "id": "bc/store/productOption/109", - "displayName": "Color", - "isShared": false, - "values": [ - { - "id": "bc/store/productOptionValue/7", - "label": "Silver", - "isDefault": false - }, - { - "id": "bc/store/productOptionValue/8", - "label": "Black", - "isDefault": false - } - ], - "overridesForLocale": { - "displayName": null, - "values": [] - } - } - }, - { - "node": { - "id": "bc/store/productOption/130", - "displayName": "Fabric", - "isShared": true, - "values": [ - { - "id": "bc/store/productOptionValue/123", - "label": "Cotton", + "label": "Large UK", "isDefault": true - }, - { - "id": "bc/store/productOptionValue/124", - "label": "Polyester", - "isDefault": false } ], - "overridesForLocale": { - "displayName": "Fabric material", - "values": [ - { - "id": "bc/store/productOptionValue/123", - "label": "Linen" - }, + "overrides": { + "edges": [ { - "id": "bc/store/productOptionValue/124", - "label": "Nylon" + "node": { + "context": { + "channelId": "bc/store/channel/1", + "locale": "fr" + }, + "displayName": "Override Size UK", + "values": [ + { + "id": "bc/store/productOptionValue/68", + "label": "Override Small UK" + }, + { + "id": "bc/store/productOptionValue/69", + "label": "Override Medium UK" + }, + { + "id": "bc/store/productOptionValue/70", + "label": "Override Large UK" + } + ] + } } ] } From 779ae25a081bdb6764aeb4bb0ad7f4ec586e5b9b Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Fri, 11 Oct 2024 16:35:50 -0700 Subject: [PATCH 10/13] change mutation for remove product modifier --- .../product-modifier-options.mdx | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx b/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx index 43e4f5112..a3bab225c 100644 --- a/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx +++ b/docs/store-operations/catalog/graphql-admin/product-modifier-options.mdx @@ -240,7 +240,7 @@ The following example removes product modifier option information for the locale mutation ($input: RemoveProductModifiersOverridesInput!) { product { - removeProductModifiersOverrides (input: $input) { + removeProductModifiersOverrides(input: $input) { product { id modifiers { @@ -248,8 +248,23 @@ The following example removes product modifier option information for the locale node { id displayName + ... on CheckboxProductModifier { + overrides(context: { channelId: "bc/store/channel/2", locale: "fr" }) { + edges { + node { + ... on CheckboxProductModifierOverridesForChannelLocale { + context { + channelId + locale + } + displayName + } + } + } + } + } } - } + } } } } @@ -298,7 +313,10 @@ The following example removes product modifier option information for the locale { "node": { "id": "bc/store/productModifier/118", - "displayName": "Include Insurance?" + "displayName": "Include Insurance?", + "overrides": { + "edges": [] + } } }, { @@ -339,20 +357,20 @@ The following example removes product modifier option information for the locale }, { "node": { - "id": "bc/store/productModifier/127", - "displayName": "Number of Pockets" + "id": "bc/store/productModifier/126", + "displayName": "Closure Type" } }, { "node": { - "id": "bc/store/productModifier/128", - "displayName": "Anniversary Date" + "id": "bc/store/productModifier/127", + "displayName": "Number of Pockets" } }, { "node": { - "id": "bc/store/productModifier/129", - "displayName": "Custom-printed Image" + "id": "bc/store/productModifier/128", + "displayName": "Anniversary Date" } } ] From 05624505fd43ee843305326131a0865e752649ff Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Fri, 11 Oct 2024 16:55:53 -0700 Subject: [PATCH 11/13] add deprecated section --- .../catalog/msf-international-enhancements.mdx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/store-operations/catalog/msf-international-enhancements.mdx b/docs/store-operations/catalog/msf-international-enhancements.mdx index c7b491b7e..f33b49d5d 100644 --- a/docs/store-operations/catalog/msf-international-enhancements.mdx +++ b/docs/store-operations/catalog/msf-international-enhancements.mdx @@ -10,7 +10,7 @@ For example, when selling products internationally, you can add information for Shoppers can then see key product details in the language of their choice throughout the complete checkout and post-order experience for a personalized shopping experience. This personalized shopping experience helps shoppers find and learn information about a product before purchasing. -The following pages provide sample queries: +The following pages provide example queries: - [Basic product information](/docs/store-operations/catalog/graphql-admin/product-basic-info) - [Product SEO information](/docs/store-operations/catalog/graphql-admin/product-seo-info) @@ -100,3 +100,12 @@ The API account should have the following OAuth scopes. | Products | read-only | `store_v2_products_read_only` | For more about BigCommerce OAuth scopes, see [API Accounts and OAuth Scopes](/docs/start/authentication/api-accounts#oauth-scopes). + + +## Deprecated + +The following are deprecated for some features, when specifying a channel and locale: +- `localeContext`. Use `overrides` in the input instead. +- `overridesForLocale`. Use `overrides` in the query or mutation. + +The example query pages contain the most up-to-date queries. Deprecated fields can be found in the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference). \ No newline at end of file From 794597935f5084b1b0f4956385a34552c05091a9 Mon Sep 17 00:00:00 2001 From: bc-andreadao <96258747+bc-andreadao@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:12:39 -0700 Subject: [PATCH 12/13] edit deprecated section --- .../catalog/msf-international-enhancements.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/store-operations/catalog/msf-international-enhancements.mdx b/docs/store-operations/catalog/msf-international-enhancements.mdx index f33b49d5d..052bd8083 100644 --- a/docs/store-operations/catalog/msf-international-enhancements.mdx +++ b/docs/store-operations/catalog/msf-international-enhancements.mdx @@ -104,8 +104,8 @@ For more about BigCommerce OAuth scopes, see [API Accounts and OAuth Scopes](/do ## Deprecated -The following are deprecated for some features, when specifying a channel and locale: -- `localeContext`. Use `overrides` in the input instead. -- `overridesForLocale`. Use `overrides` in the query or mutation. +For some features, the following fields are deprecated, when specifying a channel and locale. +- `localeContext` +- `overridesForLocale` -The example query pages contain the most up-to-date queries. Deprecated fields can be found in the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference). \ No newline at end of file +Use `overrides` in the input instead. The example query pages contain the most up-to-date queries. Deprecated fields can be found in the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference). From a6f9797e71859682aaddb8f45b88ca1de62d5df9 Mon Sep 17 00:00:00 2001 From: bc-andreadao Date: Sat, 12 Oct 2024 11:00:26 -0700 Subject: [PATCH 13/13] copyedit deprecated section --- .../catalog/msf-international-enhancements.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/store-operations/catalog/msf-international-enhancements.mdx b/docs/store-operations/catalog/msf-international-enhancements.mdx index 052bd8083..6f358a51c 100644 --- a/docs/store-operations/catalog/msf-international-enhancements.mdx +++ b/docs/store-operations/catalog/msf-international-enhancements.mdx @@ -104,8 +104,8 @@ For more about BigCommerce OAuth scopes, see [API Accounts and OAuth Scopes](/do ## Deprecated -For some features, the following fields are deprecated, when specifying a channel and locale. +For some features, the following fields are deprecated, when specifying a channel and locale. Use the `overrides` field instead. - `localeContext` - `overridesForLocale` -Use `overrides` in the input instead. The example query pages contain the most up-to-date queries. Deprecated fields can be found in the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference). +The example query pages contain the most up-to-date queries. Deprecated fields can be found in the [GraphQL Admin API reference](https://developer.bigcommerce.com/graphql-admin/reference).