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

Commit cbf0181

Browse files
keharpererikmarr
andauthored
GraphQL: Deprecate id attributes in favor of uids (#8273)
* GraphQL: Deprecate various IDs in favor of UIDs * next round * more updated examples * checkpoint * Checkpoint * Checkpoint * Update examples * Add gift card/gift wrapping * fix broken link * broken link * Apply suggestions from code review Co-authored-by: Erik Marr <45772211+erikmarr@users.noreply.github.com> Co-authored-by: Erik Marr <45772211+erikmarr@users.noreply.github.com>
1 parent bcee23e commit cbf0181

Some content is hidden

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

41 files changed

+1221
-491
lines changed

src/_data/toc/graphql.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ pages:
465465
- label: CategoryInterface attributes
466466
url: /graphql/interfaces/category-interface.html
467467

468-
- label: CustomizableOptionInterface
468+
- label: CustomizableOptionInterface attributes
469469
url: /graphql/interfaces/customizable-option-interface.html
470470

471471
- label: Bundle product data types
@@ -489,6 +489,10 @@ pages:
489489
- label: Virtual product data types
490490
url: /graphql/interfaces/virtual-product.html
491491

492+
- label: CartItemInterface attributes and implementations
493+
url: /graphql/interfaces/cart-item-interface.html
494+
exclude_versions: ["2.3"]
495+
492496
- label: CreditMemoItemInterface attributes and implementations
493497
url: /graphql/interfaces/credit-memo-item-interface.html
494498
exclude_versions: ["2.3"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Attribute | Data Type | Description
2+
--- | --- | ---
3+
`entered_options` | [EnteredOptionInput!] | An array of entered options for the base product, such as personalization text
4+
`parent_sku` | String | For child products, the SKU of its parent product
5+
`quantity` | Float! | The quantity of the item to add to the cart
6+
`selected_options` | [ID!] | The selected options for the base product, such as color or size, using the unique ID for a customizable or configurable object such as `CustomizableRadioOption`, `CustomizableDropDownOption`, or `ConfigurableProductOptionsValues`
7+
`sku` | String! | The sku of the product to be added to the cart

src/_includes/graphql/cart-object-24.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Attribute | Data Type | Description
1212
`gift_message` | [GiftMessage][GiftMessage] | A gift message added to the cart
1313
`gift_receipt_included` | Boolean! | Indicates if the customer requested a gift receipt for the cart
1414
`gift_wrapping` | [GiftWrapping][GiftWrapping] | The selected gift wrapping for the cart
15-
`id` | ID! | The ID of the cart
15+
`id` | ID! | The unique ID of the cart
1616
`is_virtual` | Boolean! | Indicates whether the cart contains only virtual products
1717
`items` | [[CartItemInterface]][CartItemInterface] | Contains the items in the customer's cart
1818
`prices` | [CartPrices][CartPrices] | Contains subtotals and totals

src/_includes/graphql/category-filter-input.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ The `CategoryFilterInput` object defines the filters to be used in this query.
22

33
Attribute | Data type | Description
44
--- | --- | ---
5-
`ids` | FilterEqualTypeInput | Filters by the specified category IDs
5+
`category_uid` | FilterEqualTypeInput | Filters by the unique category ID for a `CategoryInterface` object
6+
`ids` | FilterEqualTypeInput | Deprecated. Use `category_uid` instead. Filters by the specified category IDs
67
`name` | FilterMatchTypeInput | Filters by the display name of the category
7-
`parent_id` | FilterEqualTypeInput | Filters by parent category ID
8+
`parent_id` | FilterEqualTypeInput | Filters by the unique parent category ID for a `CategoryInterface` object
89
`url_key` | FilterEqualTypeInput | Filters by the part of the URL that identifies the category
910
`url_path` | FilterEqualTypeInput | Filters by the URL path for the category
1011

src/_includes/graphql/customer-orders-output.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Attribute | Data type | Description
5050
`gift_message` | [GiftMessage](#GiftMessage) | The entered gift message for the order
5151
`gift_receipt_included` | Boolean! | Indicates if the customer requested a gift receipt for the order
5252
`gift_wrapping` | [GiftWrapping](#GiftWrapping) | The selected gift wrapping for the order
53-
`id` | ID! | Unique identifier for the order
53+
`id` | ID! | The unique ID for a `CustomerOrder` object
5454
`increment_id` | String | Deprecated. Use the `id` attribute instead
5555
`invoices` | [[Invoice]](#Invoice)! | Contains a list of invoices for the order
5656
`items` | [[OrderItemInterface]](#OrderItemInterface) | An array containing the items purchased in this order
@@ -73,9 +73,9 @@ The `CreditMemo` object contains details about credit memos applied to an order.
7373

7474
Attribute | Data type | Description
7575
--- | --- | ---
76-
`comments` | [[SalesCommentItem]](#SalesCommentItem) | Comments on the credit memo
77-
`id` | ID! | The unique ID of the credit memo
78-
`items` | [[CreditMemoItemInterface]](#CreditMemoItemInterface) | An array containing details about refunded items
76+
`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments on the credit memo
77+
`id` | ID! | The unique ID of the `CreditMemo` object
78+
`items` | [[CreditMemoItemInterface](#CreditMemoItemInterface)] | An array containing details about refunded items
7979
`number` | String! | The sequential credit memo number
8080
`total` | [CreditMemoTotal](#CreditMemoTotal) | Contains details about the total refunded amount
8181

@@ -126,9 +126,9 @@ The `Invoice` object provides details about a customer invoice.
126126

127127
Attribute | Data type | Description
128128
--- | --- | ---
129-
`comments` | [[SalesCommentItem]](#SalesCommentItem) | Comments on the invoice
130-
`id` | ID! | The internal ID of the invoice
131-
`items` | [[InvoiceItemInterface]](#InvoiceItemInterface)! | Contains details about invoiced products
129+
`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments on the invoice
130+
`id` | ID! | The internal ID of the `Invoice` object
131+
`items` | [[InvoiceItemInterface](#InvoiceItemInterface)]! | Contains details about invoiced products
132132
`number` | String! | The sequential number of the invoice
133133
`total` | [InvoiceTotal](#InvoiceTotal)! | Invoice total amount details
134134

@@ -163,15 +163,15 @@ The ItemSelectedBundleOption object contains a list of bundle options that are a
163163

164164
Attribute | Data type | Description
165165
--- | --- | ---
166-
`id` | ID! | The unique identifier of the option
166+
`id` | ID! | The unique identifier of the ItemSelectedBundleOption object
167167
`label` | String! | The label of the option
168168
`values` | [[ItemSelectedBundleOptionValue!](#ItemSelectedBundleOptionValue)]! | A list of products that represent the values of the parent option
169169

170170
#### ItemSelectedBundleOptionValue attributes {#ItemSelectedBundleOptionValue}
171171

172172
Attribute | Data type | Description
173173
--- | --- | ---
174-
`id` | ID! | The unique identifier of the option
174+
`id` | ID! | The unique identifier of the ItemSelectedBundleOptionValue object
175175
`price` | Money! | The price of the child bundle product
176176
`product_name` | String! | The name of the child bundle product
177177
`product_sku` | String! | The SKU of the child bundle product
@@ -227,9 +227,9 @@ Attribute | Data type | Description
227227

228228
Attribute | Data type | Description
229229
--- | --- | ---
230-
`comments` | [[SalesCommentItem]](#SalesCommentItem) | Comments added to the shipment
231-
`id` | ID! | The unique ID of the shipment
232-
`items` | [[ShipmentItemInterface]](#ShipmentItemInterface) | Contains items included in the shipment
230+
`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments added to the shipment
231+
`id` | ID! | The unique ID of the OrderShipment object
232+
`items` | [[ShipmentItemInterface](#ShipmentItemInterface)] | Contains items included in the shipment
233233
`number` | String! | The sequential credit shipment number
234234
`tracking` | [[ShipmentTracking]](#ShipmentTracking) | Contains shipment tracking detail
235235

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Attribute | Data Type | Description
2+
--- | --- | ---
3+
`id` | Int | A unique ID assigned to the customizable option
4+
`value_string` | String! | A value assigned to the customizable option

src/_includes/graphql/downloadable-items-links.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Attribute | Data type | Description
66
--- | --- | ---
77
`sort_order` | Int | A number indicating the sort order
88
`title`| String | The display name of the link
9-
`uid` | ID! | A string that encodes option details
9+
`uid` | ID! | The unique ID for a `DownloadableItemsLinks` object

src/_includes/graphql/entered-option-input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ The `EnteredOptionInput` object must contain the following attributes.
22

33
Attribute | Data Type | Description
44
--- | --- | ---
5-
`uid` | ID! | An encoded ID
5+
`uid` | ID! | The unique ID for a specific `CustomizableOptionInterface` object, such as a `CustomizableFieldOption`, `CustomizableFileOption`, or `CustomizableAreaOption` object
66
`value` | String! | Text the customer entered

src/_includes/graphql/gift-wrapping.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ The `GiftWrapping` object can contain the following attributes.
33
Attribute | Data Type | Description
44
--- | --- | ---
55
`design` | String! | The name of the gift wrapping design
6-
`id` | ID! | The unique identifier for the gift wrapping option
6+
`id` | ID! | Deprecated. Use `uid` instead. The unique identifier for the gift wrapping option
77
`image` | [GiftWrappingImage](#GiftWrappingImage) | The preview image for the gift wrapping option
88
`price` | Money! | The price of the gift wrapping option
9+
`uid` | ID! | The unique identifier for the `GiftWrapping` object
910

1011
### GiftWrappingImage object {#GiftWrappingImage}
1112

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
```graphql
2+
{
3+
products(filter:
4+
{sku: {eq: "24-WG085_Group"}}
5+
)
6+
{
7+
items {
8+
uid
9+
name
10+
sku
11+
__typename
12+
... on GroupedProduct {
13+
items{
14+
qty
15+
position
16+
product{
17+
sku
18+
name
19+
__typename
20+
url_key
21+
}
22+
}
23+
}
24+
}
25+
}
26+
}
27+
```
28+
29+
{% collapsible Response %}
30+
31+
```json
32+
{
33+
"data": {
34+
"products": {
35+
"items": [
36+
{
37+
"uid": "NDU=",
38+
"name": "Set of Sprite Yoga Straps",
39+
"sku": "24-WG085_Group",
40+
"__typename": "GroupedProduct",
41+
"items": [
42+
{
43+
"qty": 0,
44+
"position": 0,
45+
"product": {
46+
"sku": "24-WG085",
47+
"name": "Sprite Yoga Strap 6 foot",
48+
"__typename": "SimpleProduct",
49+
"url_key": "sprite-yoga-strap-6-foot"
50+
}
51+
},
52+
{
53+
"qty": 0,
54+
"position": 1,
55+
"product": {
56+
"sku": "24-WG086",
57+
"name": "Sprite Yoga Strap 8 foot",
58+
"__typename": "SimpleProduct",
59+
"url_key": "sprite-yoga-strap-8-foot"
60+
}
61+
},
62+
{
63+
"qty": 0,
64+
"position": 2,
65+
"product": {
66+
"sku": "24-WG087",
67+
"name": "Sprite Yoga Strap 10 foot",
68+
"__typename": "SimpleProduct",
69+
"url_key": "sprite-yoga-strap-10-foot"
70+
}
71+
}
72+
]
73+
}
74+
]
75+
}
76+
}
77+
}
78+
```
79+
80+
{% endcollapsible %}

src/_includes/graphql/item-selected-bundle-option.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ The ItemSelectedBundleOption object contains a list of bundle options that are a
44

55
Attribute | Data type | Description
66
--- | --- | ---
7-
`id` | ID! | The unique identifier of the option
7+
`id` | ID! | Deprecated. Use `uid` instead. The unique identifier of the option
88
`label` | String! | The label of the option
9+
`uid` | ID! | The unique ID for a `ItemSelectedBundleOption` object
910
`values` | [[ItemSelectedBundleOptionValue](#ItemSelectedBundleOptionValue)] | A list of products that represent the values of the parent option
1011

1112
#### ItemSelectedBundleOptionValue attributes {#ItemSelectedBundleOptionValue}
1213

1314
Attribute | Data type | Description
1415
--- | --- | ---
15-
`id` | ID! | The unique identifier of the option
16+
`id` | ID! | Deprecated. Use `uid` instead. The unique identifier of the option
1617
`price` | Money! | The price of the child bundle product
1718
`product_name` | String! | The name of the child bundle product
1819
`product_sku` | String! | The SKU of the child bundle product
1920
`quantity` | Float! | Indicates how many of this bundle product were ordered
21+
`uid` | ID! | The unique identifier of the option

src/_includes/graphql/store-config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ Attribute | Data Type | Description | Default or example value
7272
`product_reviews_enabled` | String | Indicates whether product reviews are enabled. Possible values: 1 (Yes) and 0 (No) | 1
7373
`product_url_suffix` | String | The suffix applied to product pages, such as `.htm` or `.html` | `.html`
7474
`required_character_classes_number` | String | The number of different character classes required in a password (lowercase, uppercase, digits, special characters). <br/>Configuration path: customer/password/required_character_classes_number | 2
75-
`root_category_id` | Int | The ID of the root category | 2
75+
`root_category_id` | Int | Deprecated. Use `root_category_uid` instead. The ID of the root category | 2
76+
`root_category_uid` | Int | The unique ID for the root category object implementing `CategoryInterface` | 2
7677
`sales_fixed_product_tax_display_setting` | [FixedProductTaxDisplaySettings](#FixedProductTaxDisplaySettings) | Corresponds to the **Display Prices In Sales Modules** field. It indicates how Fixed Product Taxes information is displayed on cart, checkout, and order pages | FPT_DISABLED
7778
`sales_gift_wrapping` | String | Indicates if gift wrapping prices are displayed on the Orders page. Possible values: 1 (Yes) and 0 (No) | 1
7879
`sales_printed_card` | String | Indicates if printed card prices are displayed on the Orders page. Possible values: 1 (Yes) and 0 (No) | 1

0 commit comments

Comments
 (0)