How to translate product variants options "name" and "value" using GraphQL?

Topic summary

How to localize product variant option names and values in Shopify’s Admin GraphQL, with recent API changes and workable IDs.

  • Option names: Use translationsRegister with the ProductOption GID (gid://shopify/ProductOption/{option_id}). Get the digest via translatableResource, then register translations.
  • Option values: Earlier approaches used ProductVariant (keys option1/option2/option3). From API 2024-04, PRODUCT_VARIANT is no longer a translatable resource; use PRODUCT_OPTION_VALUE instead. Using a ProductVariant GID now returns “invalid id.”

Practical workflow:

  1. Query product to map the correct IDs: product { options { id name optionValues { id name } } }.
  2. For each Option/OptionValue ID, call translatableResource to get key and translatableContentDigest.
  3. Call translationsRegister with locale, key, value, and digest.

Notes and issues:

  • Some saw option value translations duplicate when values (e.g., “Red”) appear across multiple variants; theory: Shopify merges identical values across variants, so translating per-variant can create duplicates. Resolution not confirmed.
  • Alternative GID patterns shared: gid://shopify/Product/{product_id}/ProductOption/{option_id} for option values (community tip), and gid://shopify/ProductOption/{option_id} for names.
  • A screenshot was referenced to show duplication; not essential to follow the solution.

Status: Largely resolved with the new PRODUCT_OPTION_VALUE flow; duplication behavior remains an open question.

Summarized with AI on December 26. AI used: gpt-5.

Hi @bambopanda ,

Starting in API version 2024-04 PRODUCT_VARIANT is no longer a valid translatable resource type, it’s been replaced with PRODUCT_OPTION_VALUE so the resource ID’s being passed in would need to be different as well.

There’s a deprecation notice that provides a little more detail in the description for the PRODUCT_VARIANT value for the TranslatableResourceType enum dev docs in API version 2024-01 [dev docs link] which explains it like this:

An online store product variant. Translatable fields: option1, option2, option3. PRODUCT_VARIANT is deprecated, it is no longer a translatable resource type. Use PRODUCT_OPTION_VALUE instead.

If you’d like to discuss this change further in the forums it’s recommended that you post in the “New GraphQL Product APIs” discussion board instead which is more focused on this topic.

1 Like