Query
customer
Retrieves a single customer by their unique identifier. Requires authentication and appropriate permissions.
Signature
query { customer(id: ID!): Customer }
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
id |
ID! |
Yes | The unique identifier of the customer |
Return Type
Customer
Complexity: 1
Examples
Query
query GetCustomer($id: ID!) {
customer(id: $id) {
id
email
firstName
lastName
phone
addresses {
id
street
city
postcode
country
isDefault
}
createdAt
}
}
Variables
{
"id": "cust_xyz789"
}
Response
{
"data": {
"customer": {
"id": "cust_xyz789",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"phone": "+44 7700 900123",
"addresses": [
{
"id": "addr_001",
"street": "123 High Street",
"city": "London",
"postcode": "SW1A 1AA",
"country": "GB",
"isDefault": true
}
],
"createdAt": "2023-06-15T09:00:00Z"
}
}
}