Skip to content

Commit 455bc73

Browse files
authored
rename uuid to id_v2
1 parent 5da09fa commit 455bc73

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

design-documents/graph-ql/coverage/add-items-to-cart-single-mutation.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Each product may have options. Option can be of 2 types (see example below):
3232
```
3333

3434
We can consider "Selected Option" and "ID for Entered Option" as UUID. They meet the criteria:
35+
3536
- "Selected Option" represents option value, while "ID for Entered Option" represents option
3637
- Must be unique across different options
3738
- Returned from server
@@ -50,13 +51,14 @@ Entered options:
5051

5152
#### Option implementation
5253

53-
Product schema should be extended in order to provide option UUID.
54+
Product schema should be extended in order to provide option identifier (aka first iteration of "UUID").
55+
Until introducing UUID lets name this identifier as *"id_v2"
5456

55-
Option UUID is `base64` encoded string, that encodes details for each option and in most cases can be presented as
57+
Option *id_v2* is `base64` encoded string, that encodes details for each option and in most cases can be presented as
5658
`base64("<option-type>/<option-id>/<option-value-id>")`
57-
For example, for customizable drop-down option "Color(id = 1), with values Red(id = 1), Green(id = 2)" UUID for Color:Red will looks like `"Y3VzdG9tLW9wdGlvbi8xLzE=" => base64("custom-option/1/1")`
59+
For example, for customizable drop-down option "Color(id = 1), with values Red(id = 1), Green(id = 2)" id_v2 for Color:Red will looks like `"Y3VzdG9tLW9wdGlvbi8xLzE=" => base64("custom-option/1/1")`
5860

59-
Here is a GQL query that shows how to add a new field "uuid: String!" to cover existing cases:
61+
Here is a GQL query that shows how to add a new field "id_v2: String!" to cover existing cases:
6062

6163

6264
``` graphql
@@ -71,15 +73,15 @@ query {
7173
... on CustomizableRadioOption {
7274
title
7375
value {
74-
uuid # introduce new UUID field in CustomizableRadioValue
76+
id_v2 # introduce new id_v2 field in CustomizableRadioValue
7577
option_type_id
7678
title
7779
}
7880
}
7981
... on CustomizableDropDownOption {
8082
title
8183
value {
82-
uuid # introduce new UUID field in CustomizableDropDownValue
84+
id_v2 # introduce new id_v2 field in CustomizableDropDownValue
8385
# see \Magento\QuoteGraphQl\Model\Cart\BuyRequest\CustomizableOptionsDataProvider
8486
option_type_id
8587
title
@@ -90,15 +92,15 @@ query {
9092
} ... on ConfigurableProduct {
9193
variants {
9294
attributes {
93-
uuid # introduce new UUID field in ConfigurableAttributeOption (format: configurable/<attribute-id>/<value_index>)
95+
id_v2 # introduce new id_v2 field in ConfigurableAttributeOption (format: configurable/<attribute-id>/<value_index>)
9496
# see \Magento\ConfigurableProductGraphQl\Model\Cart\BuyRequest\SuperAttributeDataProvider
9597
code
9698
value_index
9799
}
98100
}
99101
} ... on DownloadableProduct {
100102
downloadable_product_links {
101-
uuid # introduce new UUID field in DownloadableProductLinks (format: downloadable/link/<link_id>)
103+
id_v2 # introduce new id_v2 field in DownloadableProductLinks (format: downloadable/link/<link_id>)
102104
# see \Magento\DownloadableGraphQl\Model\Cart\BuyRequest\DownloadableLinksDataProvider
103105
title
104106
}
@@ -107,15 +109,15 @@ query {
107109
sku
108110
title
109111
options {
110-
uuid # introduce new UUID field in BundleItemOption (format: bundle/<option-id>/<option-value-id>/<option-quantity>)
112+
id_v2 # introduce new id_v2 field in BundleItemOption (format: bundle/<option-id>/<option-value-id>/<option-quantity>)
111113
# see \Magento\BundleGraphQl\Model\Cart\BuyRequest\BundleDataProvider
112114
id
113115
label
114116
}
115117
}
116118
} ... on GiftCardProduct {
117119
giftcard_amounts {
118-
uuid # introduce new UUID field in GiftCardAmounts (format: giftcard/...TBD)
120+
id_v2 # introduce new id_v2 field in GiftCardAmounts (format: giftcard/...TBD)
119121
# see \Magento\GiftCard\Model\Quote\Item\CartItemProcessor::convertToBuyRequest
120122
value_id
121123
website_id

0 commit comments

Comments
 (0)