Anchor to shopLocalesshop
shopLocales
query
Requires access scope or
access scope.
A list of locales available on a shop.
Anchor to Arguments
Arguments
- Anchor to publishedpublished•BooleanDefault:false
Return only published locales.
Was this section helpful?
Anchor to Possible returnsPossible returns
- Anchor to ShopLocaleShop•
Locale A locale that's been enabled on a shop.
Was this section helpful?
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
shopLocales {
locale
primary
published
}
}`,
);
const data = await response.json();
query {
shopLocales {
locale
primary
published
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { shopLocales { locale primary published } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
shopLocales {
locale
primary
published
}
}`,
);
const data = await response.json();
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query {
shopLocales {
locale
primary
published
}
}
QUERY
response = client.query(query: query)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
shopLocales {
locale
primary
published
}
}`,
});
Response
JSON{
"shopLocales": [
{
"locale": "en",
"primary": true,
"published": true
},
{
"locale": "es",
"primary": false,
"published": true
},
{
"locale": "fr",
"primary": false,
"published": true
},
{
"locale": "ja",
"primary": false,
"published": true
}
]
}