Skip to content

Commit

Permalink
Merge pull request #154 from AdobeDocs/LYNX-162-redux
Browse files Browse the repository at this point in the history
Beta2: LYNX-162: Add uids filters to entity queries custom_attriubtes fields (redux)
  • Loading branch information
jeff-matthews authored Jun 28, 2023
2 parents f45c4d0 + 0de8c19 commit 32e30e1
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/_includes/graphql/customer-address-output-24.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/pages/_includes/graphql/customer-output-24.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
101 changes: 101 additions & 0 deletions src/pages/graphql/schema/customer/queries/customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -219,6 +220,106 @@ The following call returns the customer address custom attributes for the logged
}
```

### Retrieve custom attributes metadata filtered by `uid`

<BetaNote5 />

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.
Expand Down

0 comments on commit 32e30e1

Please sign in to comment.