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

Commit 58b8121

Browse files
Update customizable-option-interface.md (#8328)
* Update customizable-option-interface.md Added Example of the custom option type CustomizableFieldOption for the text field. * Update customizable-option-interface.md * Update customizable-option-interface.md
1 parent cbec555 commit 58b8121

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

src/guides/v2.4/graphql/interfaces/customizable-option-interface.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,75 @@ The following query returns information about the customizable options configure
268268
}
269269
}
270270
```
271+
272+
The following query returns information about the customizable options configured for the product with a `sku` of `xyz` with Custom Option type Text Field.
273+
274+
* Custom option Option Type is text field with required field.
275+
* Option Title is `Favorite Color`.
276+
* Price is `$5`, Price Type is `Fixed`, Option SKU is `favoriteColorSku` and Max. Characters is `20`.
277+
278+
**Request:**
279+
280+
```graphql
281+
{
282+
products(filter: { sku: { eq: "xyz" } }) {
283+
items {
284+
id
285+
name
286+
sku
287+
__typename
288+
... on CustomizableProductInterface {
289+
options {
290+
title
291+
required
292+
sort_order
293+
option_id
294+
... on CustomizableFieldOption {
295+
value {
296+
uid
297+
sku
298+
price
299+
price_type
300+
max_characters
301+
}
302+
}
303+
}
304+
}
305+
}
306+
}
307+
}
308+
```
309+
310+
**Response:**
311+
312+
```json
313+
{
314+
"data": {
315+
"products": {
316+
"items": [
317+
{
318+
"id": 10,
319+
"name": "Savvy Shoulder Tote",
320+
"sku": "24-WB05",
321+
"__typename": "SimpleProduct",
322+
"options": [
323+
{
324+
"title": "Favorite Color",
325+
"required": true,
326+
"sort_order": 2,
327+
"option_id": 2,
328+
"value": {
329+
"uid": "Y3VzdG9tLW9wdGlvbi8y",
330+
"sku": "favoriteColorSku",
331+
"price": 5,
332+
"price_type": "FIXED",
333+
"max_characters": 20
334+
}
335+
}
336+
]
337+
}
338+
]
339+
}
340+
}
341+
}
342+
```

0 commit comments

Comments
 (0)