shop Localesquery
query
2024-10latest
Requires read
access scope or read
access scope.
A list of locales available on a shop.
Arguments
Return only published locales.
Was this section helpful?
ShopLocale possible returns
A locale that's been enabled on a shop.
Was this section helpful?
Code examples for QUERY: shopLocales
Query Reference for QUERY: shopLocales
"{\n shopLocales {\n # ShopLocale fields\n }\n}"
Input Reference for QUERY: shopLocales
Schema Reference for QUERY: shopLocales
Display Examples for QUERY: shopLocales
[ { "example": { "type_name": "shoplocales", "title": "Retrieve a shop's locales", "description": "The following query retrieves a list of the shop's enabled locales, including the locale tag, the published state, and whether the locale tag is the primary tag.", "query_string": "query {\n shopLocales {\n locale\n primary\n published\n }\n}", "response": { "data": { "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 } ] } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/markets/store_localization/test/unit/graph_api/admin/resolvers/shop_locales_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { shopLocales { locale primary published } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n shopLocales {\n locale\n primary\n published\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n shopLocales {\n locale\n primary\n published\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n shopLocales {\n locale\n primary\n published\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n shopLocales {\n locale\n primary\n published\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [] } ]