CustomerAddressesQuery
Description
Returns the address book for the authenticated customer.
The operation name is allCustomerAddresses.
This query supports both customer storage modes used by the plugin:
- Craft Pro customer addresses
- plugin-managed customer address book
The response is normalized into one common list so frontend/admin tooling can render it consistently.
Endpoint
query allCustomerAddresses {
allCustomerAddresses {
totalCount
items {
id
name
firstname
lastname
telephone
street
city
postcode
country_code
}
}
}
Arguments
This query does not accept arguments.
Authentication
Requires authenticated GraphQL user context.
If no valid user is resolved, the query fails through the plugin auth guard.
Return Values
Returns an AddressList object:
| Field | Type | Description |
|---|---|---|
| totalCount | Int | Number of addresses returned in items. |
| items | [YuiAddress] | Address rows in normalized structure. |
Each YuiAddress item includes:
| Field | Type | Description |
|---|---|---|
| id | Int | Address identifier when available. |
| name | String | Full display name. |
| firstname | String | First name. |
| lastname | String | Last name. |
| telephone | String | Phone number. |
| street | String | Street line(s) flattened into one string. |
| city | String | City. |
| postcode | String | Postal code. |
| country_code | String | Country code. |
| company | String | Company name (if present). |
| identification_number | String | Optional company/person identifier. |
| tax_identification_number | String | Optional tax identifier. |
Usage Example
query {
allCustomerAddresses {
totalCount
items {
id
firstname
lastname
street
city
postcode
country_code
}
}
}
Notes
- The plugin resolves addresses from the active customer mode automatically.
- Response can include both billing and shipping address entries when both exist.
- Use
saveAddressmutation to create/update items and then re-run this query.