translatableResource for Article Metafield is null

translatableResource for Article Metafield is null

redochkaya
Shopify Partner
12 0 1

Trying to retrieve translatableResource for Article Metafield is returning null.

 

query {
  translatableResource(resourceId: "gid://shopify/Metafield/22357251096634") {
    resourceId
    translatableContent {
      key
      value
      digest
      locale
    } 
  }
}

The gid://shopify/Metafield/22357251096634 is correct as it's returned by the REST API.

 

The graphql request is returning:

 

{
    "data": {
        "translatableResource": null
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 2,
            "actualQueryCost": 1,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 999,
                "restoreRate": 50.0
            }
        }
    }
}

 

Strangely, the Shopify app (Translate & Adapt) seems to be able to translate the article metafields. 

 

I had a similar issue previously with product handle and it was indeed a bug in Shopify API. (see https://community.shopify.com/c/products-variants-and/how-to-localize-the-product-handle-by-using-gr...)

Replies 3 (3)

redochkaya
Shopify Partner
12 0 1

Dear shopify team, any help with this? 

richbrown_staff
Shopify Staff
651 96 160

Hi @redochkaya from the team behind Translate & Adapt and store localization at Shopify. Could you help me understand more specifically what you're aiming to do here (perhaps by video or screenshots) - is this with respect to translated content or content in the default language? Thanks

To learn more visit the Shopify Help Center or the Community Blog.

richbrown_staff
Shopify Staff
651 96 160

In short: query the article not the metafield. E.g. this is the SEO field on the article, where the data is stored on the metafield, but it acts like another field on the Article model. So translation wise, this is only translatable as a field on the Article object. We recognise it’s confusing if you're querying directly with an ID, but it’s not a bug as such:

image (85).png

To learn more visit the Shopify Help Center or the Community Blog.