mutation translationsRemove($resourceId: ID!, $translationKeys: [String!]!, $locales: [String!]!) {
translationsRemove(resourceId: $resourceId, translationKeys: $translationKeys, locales: $locales) {
userErrors {
message
field
}
translations {
key
value
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation translationsRemove($resourceId: ID!, $translationKeys: [String!]!, $locales: [String!]!) { translationsRemove(resourceId: $resourceId, translationKeys: $translationKeys, locales: $locales) { userErrors { message field } translations { key value } } }",
"variables": {
"resourceId": "gid://shopify/Product/20995642",
"locales": [
"fr"
],
"translationKeys": [
"title"
]
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation translationsRemove($resourceId: ID!, $translationKeys: [String!]!, $locales: [String!]!) {
translationsRemove(resourceId: $resourceId, translationKeys: $translationKeys, locales: $locales) {
userErrors {
message
field
}
translations {
key
value
}
}
}`,
{
variables: {
"resourceId": "gid://shopify/Product/20995642",
"locales": [
"fr"
],
"translationKeys": [
"title"
]
},
},
);
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 translationsRemove($resourceId: ID!, $translationKeys: [String!]!, $locales: [String!]!) {
translationsRemove(resourceId: $resourceId, translationKeys: $translationKeys, locales: $locales) {
userErrors {
message
field
}
translations {
key
value
}
}
}
QUERY
variables = {
"resourceId": "gid://shopify/Product/20995642",
"locales": ["fr"],
"translationKeys": ["title"]
}
response = client.query(query: query, variables: variables)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation translationsRemove($resourceId: ID!, $translationKeys: [String!]!, $locales: [String!]!) {
translationsRemove(resourceId: $resourceId, translationKeys: $translationKeys, locales: $locales) {
userErrors {
message
field
}
translations {
key
value
}
}
}`,
"variables": {
"resourceId": "gid://shopify/Product/20995642",
"locales": [
"fr"
],
"translationKeys": [
"title"
]
},
},
});
use Shopify\Clients\Graphql;
$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$query = <<<QUERY
mutation translationsRemove($resourceId: ID!, $translationKeys: [String!]!, $locales: [String!]!) {
translationsRemove(resourceId: $resourceId, translationKeys: $translationKeys, locales: $locales) {
userErrors {
message
field
}
translations {
key
value
}
}
}
QUERY;
$variables = [
"resourceId" => "gid://shopify/Product/20995642",
"locales" => ["fr"],
"translationKeys" => ["title"],
];
$response = $client->query(["query" => $query, "variables" => $variables]);