Skip to content

Commit 20f51ca

Browse files
authored
Merge pull request #457 from prabhuram93/patch-9
Updates to Configurable Options schema
2 parents 4b2371a + 4a4b6c0 commit 20f51ca

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
type ConfigurableProduct {
2-
configurable_options_selection_metadata(selectedConfigurableOptionValues: [ID!]): ConfigurableOptionsSelectionMetadata @doc(description: "Metadata for the specified configurable options selection")
2+
configurable_product_options_selection(configurableOptionValueUids: [ID!]): ConfigurableProductOptionsSelection @doc(description: "Specified configurable product options selection")
3+
variants: [ConfigurableVariant] @deprecated(reason: "Use configurable_options_selection_metadata instead.") @doc(description: "An array of variants of products") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableVariant")
4+
configurable_options: [ConfigurableProductOptions] @deprecated(reason: "Use configurable_options_selection_metadata instead.") @doc(description: "An array of linked simple product items") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Options")
35
}
46

5-
type ConfigurableOptionsSelectionMetadata @doc(description: "Metadata corresponding to the configurable options selection.")
7+
type ConfigurableProductOptionsSelection @doc(description: "Metadata corresponding to the configurable options selection.")
68
{
7-
options_available_for_selection: [ConfigurableOptionAvailableForSelection!] @doc(description: "Configurable options available for further selection based on current selection.")
9+
configurable_options: [ConfigurableProductOption!] @doc(description: "Configurable options available for further selection based on current selection.")
810
media_gallery: [MediaGalleryInterface!] @doc(description: "Product images and videos corresponding to the specified configurable options selection.")
911
variant: SimpleProduct @doc(description: "Variant represented by the specified configurable options selection. It is expected to be null, until selections are made for each configurable option.")
1012
}
1113

12-
type ConfigurableOptionAvailableForSelection @doc(description: "Configurable option available for further selection based on current selection.") {
13-
option_value_uids: [ID!]! @doc(description: "Configurable option values available for further selection.")
14-
attribute_code: String! @doc(description: "Attribute code that uniquely identifies configurable option.")
14+
type ConfigurableProductOption {
15+
uid: ID!
16+
attribute_code: String!
17+
label: String!
18+
values: [ConfigurableProductOptionValue!]
1519
}
1620

17-
# Configurable option value type has to be extended to include ID which can be used to uniquely identify the option value across the system. This is consistent with proposal of single mutation for add-to-cart
18-
type ConfigurableProductOptionsValues {
19-
uid: ID!
20-
is_available_for_selection: Boolean!
21+
type ConfigurableProductOptionValue {
22+
uid: ID! # Encoding of this uid should respect encode_algm(format: configurable/<attribute-id>/<value_index>)
23+
# refer to https://github.com/magento/architecture/blob/master/design-documents/graph-ql/coverage/cart/add-items-to-cart-single-mutation.md#single-mutation-for-adding-products-to-cart
24+
is_available: Boolean! # When display out of stock is enabled, if the option value is out of stock, this will return false
25+
is_default: Boolean!
26+
label: String!
27+
swatch: SwatchDataInterface
2128
}

0 commit comments

Comments
 (0)