From 07ca4a47b6d906450927568ce102f365e9b46b1a Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Tue, 30 May 2023 14:26:41 -0500 Subject: [PATCH 1/4] Added uids --- .../graphql/customer-address-output-24.md | 3 +- .../_includes/graphql/customer-output-24.md | 2 +- .../schema/customer/queries/customer.md | 101 ++++++++++++++++++ 3 files changed, 103 insertions(+), 3 deletions(-) diff --git a/src/pages/_includes/graphql/customer-address-output-24.md b/src/pages/_includes/graphql/customer-address-output-24.md index 477c429e3..88cca60ac 100644 --- a/src/pages/_includes/graphql/customer-address-output-24.md +++ b/src/pages/_includes/graphql/customer-address-output-24.md @@ -10,8 +10,7 @@ Attribute | Data Type | Description `company` | String | The customer's company `country_code` | CountryCodeEnum | The customer's country `country_id` | String | Deprecated. Use `country_code` instead. The customer's country -`custom_attributes` | [CustomerAddressAttribute](#customeraddress-attributes) | Deprecated. Use `custom_attributesV2` instead -`custom_attributesV2` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address +`custom_attributesV2(uids: [ID!])` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address `customer_id` | Int | Deprecated. This attribute is not applicable for GraphQL. The ID assigned to the customer `default_billing` | Boolean | Indicates whether the address is the default billing address `default_shipping` | Boolean | Indicates whether the address is the default shipping address diff --git a/src/pages/_includes/graphql/customer-output-24.md b/src/pages/_includes/graphql/customer-output-24.md index a65de749b..83e602313 100644 --- a/src/pages/_includes/graphql/customer-output-24.md +++ b/src/pages/_includes/graphql/customer-output-24.md @@ -4,7 +4,7 @@ Attribute | Data Type | Description `allow_remote_shopping_assistance` | Boolean! | Indicates whether the customer has enabled remote shopping assistance `compare_list` | CompareList | The contents of the customer's comparison list `created_at` | String | Timestamp indicating when the account was created -`custom_attributes` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address +`custom_attributes(uids: [ID!])` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address `date_of_birth` | String | The customer's date of birth. In keeping with current security and privacy best practices, be sure you are aware of any potential legal and security risks associated with the storage of customers' full date of birth (month, day, year) along with other personal identifiers, such as full name, before collecting or processing such data. `default_billing` | String | The ID assigned to the billing address `default_shipping` | String | The ID assigned to the shipping address diff --git a/src/pages/graphql/schema/customer/queries/customer.md b/src/pages/graphql/schema/customer/queries/customer.md index ece6657d3..b8da91882 100644 --- a/src/pages/graphql/schema/customer/queries/customer.md +++ b/src/pages/graphql/schema/customer/queries/customer.md @@ -6,6 +6,7 @@ import BetaNote1 from '/src/pages/_includes/graphql/notes/beta.md' import BetaNote2 from '/src/pages/_includes/graphql/notes/beta.md' import BetaNote3 from '/src/pages/_includes/graphql/notes/beta.md' import BetaNote4 from '/src/pages/_includes/graphql/notes/beta.md' +import BetaNote5 from '/src/pages/_includes/graphql/notes/beta.md' import CompareListOutput from '/src/pages/_includes/graphql/compare-list-output.md' import CustomerOrdersOutput from '/src/pages/_includes/graphql/customer-orders-output.md' import ProductReview from '/src/pages/_includes/graphql/product-review.md' @@ -219,6 +220,106 @@ The following call returns the customer address custom attributes for the logged } ``` +### Retrieve custom attributes metadata filtered by `uid` + + + +The following call returns the customer and customer address custom attributes for the logged-in customer filtered by `uid`. Provide the customer's token in the header section of the query. + +**Request:** + +```graphql +{ + customer { + email + custom_attributes(uids: ["Y3VzdG9tZXIvc3R1ZGllcw=="]) { + uid + code + ... on AttributeValue { + value + } + ... on AttributeSelectedOptions { + selected_options { + uid + label + value + } + } + } + addresses { + city + custom_attributesV2(uids: ["Y3VzdG9tZXJfYWRkcmVzcy9zZXJ2aWNlcw=="]) { + uid + code + ... on AttributeValue { + value + } + ... on AttributeSelectedOptions { + selected_options { + uid + label + value + } + } + } + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "customer": { + "email": "jdoe@example.com", + "custom_attributes": [ + { + "uid": "Y3VzdG9tZXIvc3R1ZGllcw==", + "code": "studies", + "selected_options": [ + { + "uid": "NTEw", + "label": "BSc", + "value": "501" + }, + { + "uid": "NTEx", + "label": "MBA", + "value": "502" + } + ] + } + ], + "addresses": [ + { + "city": "Marseille", + "custom_attributesV2": [ + { + "uid": "Y3VzdG9tZXJfYWRkcmVzcy9zZXJ2aWNlcw==", + "code": "services", + "selected_options": [ + { + "uid": "NTA3", + "label": "hospital", + "value": "507" + }, + { + "uid": "NTA4", + "label": "police", + "value": "508" + } + ] + } + ] + } + ] + } + } +} +``` + ### Retrieve a summary of the customer's order history The following example returns a summary of the logged-in customer's previous orders. From b3aff6b2220f250a6300fe756aebbea7bb236a2d Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Tue, 30 May 2023 14:29:57 -0500 Subject: [PATCH 2/4] Fixed include reference --- src/pages/graphql/schema/customer/queries/customer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/graphql/schema/customer/queries/customer.md b/src/pages/graphql/schema/customer/queries/customer.md index b8da91882..71824ab6f 100644 --- a/src/pages/graphql/schema/customer/queries/customer.md +++ b/src/pages/graphql/schema/customer/queries/customer.md @@ -222,7 +222,7 @@ The following call returns the customer address custom attributes for the logged ### Retrieve custom attributes metadata filtered by `uid` - + The following call returns the customer and customer address custom attributes for the logged-in customer filtered by `uid`. Provide the customer's token in the header section of the query. From 596e5993b7ec7a2d900bba333e9a2ef21af1bae2 Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Wed, 28 Jun 2023 10:01:14 -0500 Subject: [PATCH 3/4] LYNX-162: Undeleted custom_attributes --- src/pages/_includes/graphql/customer-address-output-24.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/_includes/graphql/customer-address-output-24.md b/src/pages/_includes/graphql/customer-address-output-24.md index 88cca60ac..edf197d1e 100644 --- a/src/pages/_includes/graphql/customer-address-output-24.md +++ b/src/pages/_includes/graphql/customer-address-output-24.md @@ -10,6 +10,7 @@ Attribute | Data Type | Description `company` | String | The customer's company `country_code` | CountryCodeEnum | The customer's country `country_id` | String | Deprecated. Use `country_code` instead. The customer's country +`custom_attributes` | [CustomerAddressAttribute](#customeraddress-attributes) | Deprecated. Use `custom_attributesV2` instead `custom_attributesV2(uids: [ID!])` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address `customer_id` | Int | Deprecated. This attribute is not applicable for GraphQL. The ID assigned to the customer `default_billing` | Boolean | Indicates whether the address is the default billing address From 0de8c1928c0c053758cea1c9f89a956c0397c0fe Mon Sep 17 00:00:00 2001 From: Jeff Matthews Date: Wed, 28 Jun 2023 10:03:52 -0500 Subject: [PATCH 4/4] LYNX-162: Missed an include --- src/pages/_includes/graphql/customer-address-output-24.md | 2 +- src/pages/_includes/graphql/customer-output-24.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/_includes/graphql/customer-address-output-24.md b/src/pages/_includes/graphql/customer-address-output-24.md index edf197d1e..702e22476 100644 --- a/src/pages/_includes/graphql/customer-address-output-24.md +++ b/src/pages/_includes/graphql/customer-address-output-24.md @@ -11,7 +11,7 @@ Attribute | Data Type | Description `country_code` | CountryCodeEnum | The customer's country `country_id` | String | Deprecated. Use `country_code` instead. The customer's country `custom_attributes` | [CustomerAddressAttribute](#customeraddress-attributes) | Deprecated. Use `custom_attributesV2` instead -`custom_attributesV2(uids: [ID!])` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address +`custom_attributesV2(uids: [ID!])` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address (2.4.7-beta only) `customer_id` | Int | Deprecated. This attribute is not applicable for GraphQL. The ID assigned to the customer `default_billing` | Boolean | Indicates whether the address is the default billing address `default_shipping` | Boolean | Indicates whether the address is the default shipping address diff --git a/src/pages/_includes/graphql/customer-output-24.md b/src/pages/_includes/graphql/customer-output-24.md index 83e602313..95a402fb4 100644 --- a/src/pages/_includes/graphql/customer-output-24.md +++ b/src/pages/_includes/graphql/customer-output-24.md @@ -4,7 +4,8 @@ Attribute | Data Type | Description `allow_remote_shopping_assistance` | Boolean! | Indicates whether the customer has enabled remote shopping assistance `compare_list` | CompareList | The contents of the customer's comparison list `created_at` | String | Timestamp indicating when the account was created -`custom_attributes(uids: [ID!])` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address +`custom_attributes` | [CustomerAddressAttribute](#customeraddress-attributes) | Deprecated. Use `custom_attributesV2` instead +`custom_attributes(uids: [ID!])` | [AttributeValueInterface](#attributevalueinterface-attributes)| Custom attributes assigned to the customer address (2.4.7-beta only) `date_of_birth` | String | The customer's date of birth. In keeping with current security and privacy best practices, be sure you are aware of any potential legal and security risks associated with the storage of customers' full date of birth (month, day, year) along with other personal identifiers, such as full name, before collecting or processing such data. `default_billing` | String | The ID assigned to the billing address `default_shipping` | String | The ID assigned to the shipping address