diff --git a/src/pages/_includes/graphql/customer-address-output-24.md b/src/pages/_includes/graphql/customer-address-output-24.md index 477c429e3..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` | [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 a65de749b..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` | [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 diff --git a/src/pages/graphql/schema/customer/queries/customer.md b/src/pages/graphql/schema/customer/queries/customer.md index ece6657d3..71824ab6f 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.