Get Single Locale
About
The locale query retrieves a single locale by ID with support for detailed field access. This query is essential for:
- Fetching specific locale details for UI configuration
- Checking text direction (LTR/RTL) for layout adjustments
- Retrieving locale-specific branding and logos
- Validating locale existence before operations
- Building locale detail pages
- Configuring locale-specific settings
The query allows you to fetch a specific locale with all its properties and relationships.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | Yes | The unique identifier of the locale. Can be either numeric ID or IRI format (/api/shop/locales/{id}). |
Possible Returns
| Field | Type | Description |
|---|---|---|
locale | Locale | The requested locale object, or null if not found. |
Locale Fields
| Field | Type | Description |
|---|---|---|
id | String! | Unique identifier in format /api/shop/locales/{id} |
_id | Int! | Numeric identifier for the locale |
code | String! | Unique locale code (e.g., "en", "AR") |
name | String! | Display name of the locale (e.g., "English", "Arabic") |
direction | String! | Text direction: "ltr" (left-to-right) or "rtl" (right-to-left) |
logoPath | String | File path to the locale logo (e.g., "locales/en.png") |
logoUrl | String | Full URL to the locale logo image |
Error Handling
Locale Not Found
json
{
"data": {
"locale": null
}
}Missing Required ID Parameter
json
{
"errors": [
{
"message": "Field \"locale\" argument \"id\" of type \"ID!\" is required but not provided."
}
]
}Related Resources
- Get Locales - Retrieve all locales with pagination

