Get Locales
About
The getLocales query retrieves locale information from your store with support for pagination and detailed field access. This query is essential for:
- Displaying available language and locale options
- Building multi-language selector interfaces
- Determining text direction (LTR/RTL) for UI layout
- Retrieving locale-specific logos and branding
- Managing store language configurations
- Building locale management interfaces
The query supports cursor-based pagination and allows you to fetch all locales with full relationship access.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
first | Int | No | Number of locales to retrieve from the start (forward pagination). Max: 100. |
after | String | No | Cursor to start after for forward pagination. |
last | Int | No | Number of locales to retrieve from the end (backward pagination). Max: 100. |
before | String | No | Cursor to start before for backward pagination. |
Possible Returns
| Field | Type | Description |
|---|---|---|
edges | [LocaleEdge!]! | Array of locale edges containing locales and cursors. |
edges.node | Locale! | The actual locale object with id, code, name, direction, and other fields. |
edges.cursor | String! | Pagination cursor for this locale. Use with after or before arguments. |
pageInfo | PageInfo! | Pagination metadata object. |
pageInfo.hasNextPage | Boolean! | Whether more locales exist after the current page. |
pageInfo.hasPreviousPage | Boolean! | Whether locales exist before the current page. |
pageInfo.startCursor | String | Cursor of the first locale on the current page. |
pageInfo.endCursor | String | Cursor of the last locale on the current page. |
totalCount | Int! | Total number of locales available. |
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 |

