I found that I can use nestedTranslatableResources
to translate PRODUCT metafields.
But when I try to get COLLECTION nestedTranslatableResources
, I got empty.
If I use translatableResourcesByIds(id: "<collection_metafield_id>")
, I got the result. Why?
>>>
query {
collection(id: "gid://shopify/Collection/318034706604") {
metafields(first: 250) {
nodes {
id
namespace
key
}
}
}
}
>>>
<<<
{
"data": {
"collection": {
"metafields": {
"nodes": [
{
"id": "gid://shopify/Metafield/29786094829740",
"namespace": "custom",
"key": "faq"
}
]
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 14,
"actualQueryCost": 4,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1996,
"restoreRate": 100
}
}
}
}
<<<
>>>
query {
translatableResourcesByIds(resourceIds: ["gid://shopify/Metafield/29786094829740"], first: 250){
nodes{
resourceId
translatableContent {
locale
key
type
digest
value
}
}
}
}
>>>
<<<
{
"data": {
"translatableResourcesByIds": {
"nodes": [
{
"resourceId": "gid://shopify/Metafield/29786094829740",
"translatableContent": [
{
"locale": "zh-CN",
"key": "value",
"type": "MULTI_LINE_TEXT_FIELD",
"digest": "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
"value": "abc"
}
]
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 24,
"actualQueryCost": 4,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1996,
"restoreRate": 100
}
}
}
}
<<<
>>>
query($resourceIds: [ID!]!, $localeToTranslate: String!) {
translatableResourcesByIds(first: 250, resourceIds: $resourceIds) {
nodes {
resourceId
nestedTranslatableResources(first: 250) {
nodes {
resourceId
translations(locale: $localeToTranslate) {
key
locale
value
outdated
updatedAt
}
translatableContent {
digest
type
key
value
locale
}
}
}
translations(locale: $localeToTranslate) {
key
locale
value
outdated
updatedAt
}
translatableContent {
locale
value
key
type
digest
}
}
}
}
variables
{
"localeToTranslate": "en",
"resourceIds": ["gid://shopify/Collection/318034706604"]
}
>>>
<<<
{
"data": {
"translatableResourcesByIds": {
"nodes": [
{
"resourceId": "gid://shopify/Collection/318034706604",
"nestedTranslatableResources": {
"nodes": [] // empty?
},
"translations": [
{
"key": "title",
"locale": "en",
"value": "AccessoriesEn",
"outdated": false,
"updatedAt": "2025-07-21T06:36:31Z"
}
],
"translatableContent": [
{
"locale": "zh-CN",
"value": "Accessories",
"key": "title",
"type": "SINGLE_LINE_TEXT_FIELD",
"digest": "b08648dbd62b71bd0027809076ca755dbfe4f120553ce6f60d910143082d70db"
},
{
"locale": "zh-CN",
"value": "",
"key": "body_html",
"type": "HTML",
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"locale": "zh-CN",
"value": "accessories-accessories",
"key": "handle",
"type": "URI",
"digest": "57b2e0aba01a79058c4f4dfc3c58045d4a8637e4a3c5f76c41ed0c4eb5562c16"
}
]
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 420,
"actualQueryCost": 7,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1993,
"restoreRate": 100
}
}
}
}
<<<