Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 542b1ee

Browse files
authored
Merge pull request #7797 from magento/kh_interfaces-master
GraphQL: Move files to an interfaces directory
2 parents f22b2d6 + 18d3c75 commit 542b1ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1268
-87
lines changed

src/_data/toc/graphql.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,34 +246,34 @@ pages:
246246
- label: updateCustomerAddress mutation
247247
url: /graphql/mutations/update-customer-address.html
248248

249-
- label: Catalog data types and interfaces
249+
- label: Interfaces
250250
children:
251251
- label: Product interface implementations
252-
url: /graphql/product/product-interface-implementations.html
252+
url: /graphql/interfaces/product-interface-implementations.html
253253

254254
- label: ProductInterface attributes
255-
url: /graphql/product/product-interface.html
255+
url: /graphql/interfaces/product-interface.html
256256

257257
- label: CategoryInterface attributes
258-
url: /graphql/product/category-interface.html
258+
url: /graphql/interfaces/category-interface.html
259259

260260
- label: CustomizableOptionInterface
261-
url: /graphql/product/customizable-option-interface.html
261+
url: /graphql/interfaces/customizable-option-interface.html
262262

263263
- label: Bundle product data types
264-
url: /graphql/product/bundle-product.html
264+
url: /graphql/interfaces/bundle-product.html
265265

266266
- label: Configurable product data types
267-
url: /graphql/product/configurable-product.html
267+
url: /graphql/interfaces/configurable-product.html
268268

269269
- label: Downloadable product data types
270-
url: /graphql/product/downloadable-product.html
270+
url: /graphql/interfaces/downloadable-product.html
271271

272272
- label: GiftCardProduct data types
273-
url: /graphql/product/gift-card-product.html
273+
url: /graphql/interfaces/gift-card-product.html
274274

275275
- label: GroupedProduct data types
276-
url: /graphql/product/grouped-product.html
276+
url: /graphql/interfaces/grouped-product.html
277277

278278
- label: Payment methods
279279
children:

src/_data/whats-new.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ entries:
828828
type: Major Update
829829
date: April 27, 2020
830830
link: https://github.com/magento/devdocs/pull/6967
831-
- description: Added an example of returning swatch information in a products query to [Configurable product data types](https://devdocs.magento.com/guides/v2.3/graphql/product/configurable-product.html) in the _GraphQL Developer Guide_.
831+
- description: Added an example of returning swatch information in a products query to [Configurable product data types](https://devdocs.magento.com/guides/v2.3/graphql/interfaces/configurable-product.html) in the _GraphQL Developer Guide_.
832832
versions: 2.3.5
833833
type: Major Update
834834
date: April 27, 2020
@@ -1441,7 +1441,7 @@ entries:
14411441
type: Technical changes
14421442
date: January 28, 2020
14431443
link: https://github.com/magento/devdocs/pull/5448
1444-
- description: Updated the [ProductInterface](https://devdocs.magento.com/guides/v2.3/graphql/product/product-interface.html)
1444+
- description: Updated the [ProductInterface](https://devdocs.magento.com/guides/v2.3/graphql/interfaces/product-interface.html)
14451445
documentation in the _GraphQL Developer Guide_ to include new data types and attributes
14461446
that support tier pricing and price ranges in composite products.
14471447
versions: 2.3.4
@@ -1802,7 +1802,7 @@ entries:
18021802
type: Major update
18031803
date: October 18, 2019
18041804
link: https://github.com/magento/devdocs/pull/5800
1805-
- description: Moved the `CategoryInterface` attributes to a separate [topic](https://devdocs.magento.com/guides/v2.3/graphql/product/category-interface.html)
1805+
- description: Moved the `CategoryInterface` attributes to a separate [topic](https://devdocs.magento.com/guides/v2.3/graphql/interfaces/category-interface.html)
18061806
in the _GraphQL Developer Guide_.
18071807
versions: 2.3.x
18081808
type: New topic
@@ -3262,8 +3262,8 @@ entries:
32623262
type: Technical changes
32633263
date: March 26, 2019
32643264
link: https://github.com/magento/devdocs/pull/3882
3265-
- description: Added query and mutation to the [configurable]( https://devdocs.magento.com/guides/v2.3/graphql/product/configurable-product.html)
3266-
and [downloadable product](https://devdocs.magento.com/guides/v2.3/graphql/product/downloadable-product.html)
3265+
- description: Added query and mutation to the [configurable]( https://devdocs.magento.com/guides/v2.3/graphql/interfaces/configurable-product.html)
3266+
and [downloadable product](https://devdocs.magento.com/guides/v2.3/graphql/interfaces/downloadable-product.html)
32673267
endpoints
32683268
versions: 2.3.1
32693269
type: Major update
@@ -3291,7 +3291,7 @@ entries:
32913291
type: New topic
32923292
date: March 26, 2019
32933293
link: https://github.com/magento/devdocs/pull/3855
3294-
- description: Added an example to [CustomizableOptionInterface](https://devdocs.magento.com/guides/v2.3/graphql/product/customizable-option-interface.html)
3294+
- description: Added an example to [CustomizableOptionInterface](https://devdocs.magento.com/guides/v2.3/graphql/interfaces/customizable-option-interface.html)
32953295
versions: 2.3.1
32963296
type: Major update
32973297
date: March 26, 2019

src/guides/v2.3/graphql/product/bundle-product.md renamed to src/guides/v2.3/graphql/interfaces/bundle-product.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ group: graphql
33
title: Bundle product data types
44
redirect_from:
55
- /guides/v2.3/graphql/reference/bundle-product.html
6+
- /guides/v2.3/graphql/product/bundle-product.html
67
---
78

89
The `BundleProduct` data type implements the following interfaces:
@@ -53,7 +54,7 @@ Attribute | Type | Description
5354
`position` | Int | When a bundle item contains multiple options, the relative position of this option compared to the other options
5455
`price_type` | PriceTypeEnum | One of FIXED, PERCENT, or DYNAMIC
5556
`price` | Float | The price of the selected option
56-
`product` | [ProductInterface]({{page.baseurl}}/graphql/product/product-interface.html) | Contains details about this product option
57+
`product` | [ProductInterface]({{page.baseurl}}/graphql/interfaces/product-interface.html) | Contains details about this product option
5758
`qty` | Float | Deprecated. Use `quantity` instead
5859
`quantity` | Float | Indicates the quantity of this specific bundle item
5960

src/guides/v2.3/graphql/product/category-interface.md renamed to src/guides/v2.3/graphql/interfaces/category-interface.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
group: graphql
33
title: CategoryInterface attributes
4+
redirect_from:
5+
- /guides/v2.3/graphql/product/category-interface.html
46
---
57

68
`CategoryInterface` defines attributes that can be returned in the [`category` query]({{page.baseurl}}/graphql/queries/category.html) and the [`products` query]({{page.baseurl}}/graphql/queries/products.html).
@@ -56,7 +58,7 @@ The `CategoryProducts` object contains the following attributes:
5658

5759
Attribute | Data type | Description
5860
--- | --- | ---
59-
`items` | [ProductInterface] | An array of products that are assigned to the category. See [ProductInterface]({{ page.baseurl }}/graphql/product/product-interface.html) for more information
61+
`items` | [ProductInterface] | An array of products that are assigned to the category. See [ProductInterface]({{ page.baseurl }}/graphql/interfaces/product-interface.html) for more information
6062
`page_info` | `SearchResultPageInfo` | An object that includes the `page_info` and `currentPage` values specified in the query
6163
`total_count` | Int | The number of products returned
6264

src/guides/v2.3/graphql/product/configurable-product.md renamed to src/guides/v2.3/graphql/interfaces/configurable-product.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ group: graphql
33
title: Configurable product data types
44
redirect_from:
55
- /guides/v2.3/graphql/reference/configurable-product.html
6+
- /guides/v2.3/graphql/product/configurable-product.html
67
---
78

89
The `ConfigurableProduct` data type implements the following interfaces:
Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
---
2+
group: graphql
3+
title: CustomizableOptionInterface
4+
redirect_from:
5+
- /guides/v2.3/graphql/reference/customizable-option-interface.html
6+
- /guides/v2.3/graphql/product/customizable-option-interface.html
7+
---
8+
9+
Customizable options for a product provide a way to offer customers a selection of options with a variety of text, selection, and date input types. All product types can contain customizable options.
10+
11+
`CustomizableOptionInterface` is defined in the `CatalogGraphQl` module, and its attributes can be used in any `products` query. This interface returns basic information about a customizable option and can be implemented by several types of configurable options:
12+
13+
* Text area
14+
* Checkbox
15+
* Date picker
16+
* Drop-down menu
17+
* Text field
18+
* File picker
19+
* Multiple select box
20+
* Radio buttons
21+
22+
{:.bs-callout-info}
23+
Magento has not implemented all possible customizable product options for GraphQL.
24+
25+
`CustomizableOptionInterface` can contain the following attributes:
26+
27+
Attribute | Type | Description
28+
--- | --- | ---
29+
`option_id` | Int | The ID assigned to the option
30+
`required` | Boolean | Indicates whether the option is required
31+
`sort_order` | Int | The order in which the option is displayed
32+
`title` | String | The display name for this option
33+
34+
## CustomizableAreaOption object
35+
36+
`CustomizableAreaOption` contains information about a text area that is defined as part of a customizable option.
37+
38+
Attribute | Type | Description
39+
--- | --- | ---
40+
`product_sku` | String | The Stock Keeping Unit of the base product
41+
`value` | `CustomizableAreaValue` | An object that defines a text area
42+
43+
### CustomizableAreaValue object
44+
45+
`CustomizableAreaValue` defines the attributes of a product whose page contains a customized text area.
46+
47+
Attribute | Type | Description
48+
--- | --- | ---
49+
`max_characters` | Int | The maximum number of characters that can be entered for this customizable option
50+
`price_type` | PriceTypeEnum | FIXED, PERCENT, or DYNAMIC
51+
`price` | Float | The price assigned to this option
52+
`sku` | String | The Stock Keeping Unit for this option
53+
54+
## CustomizableCheckboxOption object
55+
56+
`CustomizableCheckboxOption` contains information about a set of checkbox values that are defined as part of a customizable option.
57+
58+
Attribute | Type | Description
59+
--- | --- | ---
60+
`value` | `CustomizableCheckboxValue` | An array that defines a set of checkbox values
61+
62+
### CustomizableCheckboxValue object
63+
64+
`CustomizableCheckboxValue` defines the attributes of a product whose page contains a customized set of checkbox values.
65+
66+
Attribute | Type | Description
67+
--- | --- | ---
68+
`option_type_id` | Int | The ID assigned to the value
69+
`price_type` | PriceTypeEnum | FIXED, PERCENT, or DYNAMIC
70+
`price` | Float | The price assigned to this option
71+
`sku` | String | The Stock Keeping Unit for this option
72+
`sort_order` | Int | The order in which the option is displayed
73+
`title` | String | The display name for this option
74+
75+
## CustomizableDateOption object
76+
77+
`CustomizableDateOption` contains information about a date picker that is defined as part of a customizable option.
78+
79+
Attribute | Type | Description
80+
--- | --- | ---
81+
`product_sku` | String | The Stock Keeping Unit of the base product
82+
`value` | `CustomizableDateValue` | An object that defines a date field in a customizable option.
83+
84+
### CustomizableDateValue object
85+
86+
`CustomizableDateValue` defines the attributes of a product whose page contains a customized date picker.
87+
88+
Attribute | Type | Description
89+
--- | --- | ---
90+
`price` | Float | The price assigned to this option
91+
`price_type` | PriceTypeEnum | FIXED, PERCENT, or DYNAMIC
92+
`sku` | String | The Stock Keeping Unit for this option
93+
94+
## CustomizableDropDownOption object
95+
96+
`CustomizableDropDownOption` contains information about a drop down menu that is defined as part of a customizable option.
97+
98+
Attribute | Type | Description
99+
--- | --- | ---
100+
`value` | `CustomizableDropDownValue` | An array that defines the set of options for a drop down menu
101+
102+
### CustomizableDropDownValue object
103+
104+
`CustomizableDropDownValue` defines the attributes of a product whose page contains a customized drop down menu.
105+
106+
Attribute | Type | Description
107+
--- | --- | ---
108+
`option_type_id` | Int | The ID assigned to the value
109+
`price_type` | PriceTypeEnum | FIXED, PERCENT, or DYNAMIC
110+
`price` | Float | The price assigned to this option
111+
`sku` | String | The Stock Keeping Unit for this option
112+
`sort_order` | Int | The order in which the option is displayed
113+
`title` | String | The display name for this option
114+
115+
## CustomizableFieldOption object
116+
117+
`CustomizableFieldOption` contains information about a text field that is defined as part of a customizable option.
118+
119+
Attribute | Type | Description
120+
--- | --- | ---
121+
`product_sku` | String | The Stock Keeping Unit of the base product
122+
`value` | `CustomizableFieldValue` | An object that defines a text field
123+
124+
### CustomizableFieldValue object
125+
126+
`CustomizableFieldValue` defines the attributes of a product whose page contains a customized text field.
127+
128+
Attribute | Type | Description
129+
--- | --- | ---
130+
`max_characters` | Int | The maximum number of characters that can be entered for this customizable option
131+
`price_type` | PriceTypeEnum | FIXED, PERCENT, or DYNAMIC
132+
`price` | Float | The price of the custom value
133+
`sku` | String | The Stock Keeping Unit for this option
134+
135+
## CustomizableFileOption object
136+
137+
`CustomizableFileOption` contains information about a file picker that is defined as part of a customizable option.
138+
139+
Attribute | Type | Description
140+
--- | --- | ---
141+
`product_sku` | String | The Stock Keeping Unit of the base product
142+
`value` | `CustomizableFileValue` | An object that defines a file name
143+
144+
### CustomizableFileValue object
145+
146+
`CustomizableFileValue` defines the attributes of a product whose page contains a customized file picker.
147+
148+
Attribute | Type | Description
149+
--- | --- | ---
150+
`file_extension` | String | The file extension to accept
151+
`image_size_x` | Int | The maximum width of an image
152+
`image_size_y` | Int | The maximum height of an image
153+
`price_type` | PriceTypeEnum | FIXED, PERCENT, or DYNAMIC
154+
`price` | Float | The price assigned to this option
155+
`sku` | String | The Stock Keeping Unit for this option
156+
157+
## CustomizableMultipleOption object
158+
159+
`CustomizableMultipleOption` contains information about a multiselect that is defined as part of a customizable option.
160+
161+
Attribute | Type | Description
162+
--- | --- | ---
163+
`value` | `CustomizableMultipleValue` | An array that defines the set of options for a multiselect
164+
165+
### CustomizableMultipleValue object
166+
167+
`CustomizableMultipleValue` defines the price and sku of a product whose page contains a customized multiselect
168+
169+
Attribute | Type | Description
170+
--- | --- | ---
171+
`option_type_id` | Int | The ID assigned to the value
172+
`price_type` | PriceTypeEnum | FIXED, PERCENT, or DYNAMIC
173+
`price` | Float | The price assigned to this option
174+
`sku` | String | The Stock Keeping Unit for this option
175+
`sort_order` | Int | The order in which the option is displayed
176+
`title` | String | The display name for this option
177+
178+
## CustomizableRadioOption object
179+
180+
`CustomizableRadioOption` contains information about a set of radio buttons that are defined as part of a customizable option.
181+
182+
Attribute | Type | Description
183+
--- | --- | ---
184+
`value` | `CustomizableRadioValue` | An array that defines a set of radio buttons
185+
186+
### CustomizableRadioValue object
187+
188+
`CustomizableRadioValue` defines the attributes of a product whose page contains a customized set of radio buttons.
189+
190+
Attribute | Type | Description
191+
--- | --- | ---
192+
`option_type_id` | Int | The ID assigned to the value
193+
`price_type` | PriceTypeEnum | FIXED, PERCENT, or DYNAMIC
194+
`price` | Float | The price assigned to this option
195+
`sku` | String | The Stock Keeping Unit for this option
196+
`sort_order` | Int | The order in which the option is displayed
197+
`title` | String | The display name for this option## CustomizableRadioOption object
198+
199+
`CustomizableRadioOption` contains information about a set of radio buttons that are defined as part of a customizable option.
200+
201+
Attribute | Type | Description
202+
--- | --- | ---
203+
`value` | `CustomizableRadioValue` | An array that defines a set of radio buttons
204+
205+
## Example usage
206+
207+
The following query returns information about the customizable options configured for the product with a `sku` of `xyz`.
208+
209+
**Request:**
210+
211+
```graphql
212+
{
213+
products(filter: {sku: {eq: "xyz"}}) {
214+
items {
215+
id
216+
name
217+
sku
218+
__typename
219+
... on CustomizableProductInterface {
220+
options {
221+
title
222+
required
223+
sort_order
224+
option_id
225+
}
226+
}
227+
}
228+
}
229+
}
230+
```
231+
232+
**Response:**
233+
234+
```json
235+
{
236+
"data": {
237+
"products": {
238+
"items": [
239+
{
240+
"id": 1,
241+
"name": "T-shirt",
242+
"sku": "xyz",
243+
"__typename": "SimpleProduct",
244+
"options": [
245+
{
246+
"title": "Image",
247+
"required": false,
248+
"sort_order": 1,
249+
"option_id": 1
250+
}
251+
]
252+
}
253+
]
254+
}
255+
}
256+
}
257+
```

0 commit comments

Comments
 (0)