Anchor to section titled 'undefined'

shopLocaleDisable
mutation

Requires write_locales access scope.

Deletes a locale for a shop. This also deletes all translations of this locale.


ISO code of the locale to delete.


Was this section helpful?

ISO code of the locale that was deleted.

The list of errors that occurred from executing the mutation.


Was this section helpful?

Examples

Hide code
DescriptionCopy
mutation disableLocale($locale: String!) {
  shopLocaleDisable(locale: $locale) {
    userErrors {
      message
      field
    }
    locale
  }
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation disableLocale($locale: String!) { shopLocaleDisable(locale: $locale) { userErrors { message field } locale } }",
 "variables": {
    "locale": "ko"
  }
}'
const { admin } = await authenticate.admin(request);

const response = await admin.graphql(
  `#graphql
  mutation disableLocale($locale: String!) {
    shopLocaleDisable(locale: $locale) {
      userErrors {
        message
        field
      }
      locale
    }
  }`,
  {
    variables: {
      "locale": "ko"
    },
  },
);

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
  mutation disableLocale($locale: String!) {
    shopLocaleDisable(locale: $locale) {
      userErrors {
        message
        field
      }
      locale
    }
  }
QUERY

variables = {
  "locale": "ko"
}

response = client.query(query: query, variables: variables)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
  data: {
    "query": `mutation disableLocale($locale: String!) {
      shopLocaleDisable(locale: $locale) {
        userErrors {
          message
          field
        }
        locale
      }
    }`,
    "variables": {
      "locale": "ko"
    },
  },
});
use Shopify\Clients\Graphql;

$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$query = <<<QUERY
  mutation disableLocale($locale: String!) {
    shopLocaleDisable(locale: $locale) {
      userErrors {
        message
        field
      }
      locale
    }
  }
QUERY;

$variables = [
  "locale" => "ko",
];

$response = $client->query(["query" => $query, "variables" => $variables]);
Hide code
Input variables
Copy
{
  "locale": "ko"
}
Hide code
Response
JSON
{
  "shopLocaleDisable": {
    "userErrors": [],
    "locale": "ko"
  }
}