Skip to content

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

ArgumentTypeRequiredDescription
idID!YesThe unique identifier of the locale. Can be either numeric ID or IRI format (/api/shop/locales/{id}).

Possible Returns

FieldTypeDescription
localeLocaleThe requested locale object, or null if not found.

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

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."
    }
  ]
}

Released under the MIT License.