Skip to content

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

ArgumentTypeRequiredDescription
firstIntNoNumber of locales to retrieve from the start (forward pagination). Max: 100.
afterStringNoCursor to start after for forward pagination.
lastIntNoNumber of locales to retrieve from the end (backward pagination). Max: 100.
beforeStringNoCursor to start before for backward pagination.

Possible Returns

FieldTypeDescription
edges[LocaleEdge!]!Array of locale edges containing locales and cursors.
edges.nodeLocale!The actual locale object with id, code, name, direction, and other fields.
edges.cursorString!Pagination cursor for this locale. Use with after or before arguments.
pageInfoPageInfo!Pagination metadata object.
pageInfo.hasNextPageBoolean!Whether more locales exist after the current page.
pageInfo.hasPreviousPageBoolean!Whether locales exist before the current page.
pageInfo.startCursorStringCursor of the first locale on the current page.
pageInfo.endCursorStringCursor of the last locale on the current page.
totalCountInt!Total number of locales available.

Locale Fields

FieldTypeDescription
idString!Unique identifier in format /api/shop/locales/{id}
_idInt!Numeric identifier for the locale
codeString!Unique locale code (e.g., "en", "AR")
nameString!Display name of the locale (e.g., "English", "Arabic")
directionString!Text direction: "ltr" (left-to-right) or "rtl" (right-to-left)
logoPathStringFile path to the locale logo (e.g., "locales/en.png")
logoUrlStringFull URL to the locale logo image

Released under the MIT License.