Following the field level translation documentation, I have a content object that contains the languages as keys. Normally I can access any field like this.
"content": coalesce(content[$lang], content.en)
This content is a Portable text field, and I want to query the current language or fallback, but I want to be able to reach the references inside that object, like referenced images.
Say I want to access this asset of
pageImage
that is a block inside `content`:
_type == "pageImage" => {
...,
"alt": coalesce(alt[$lang], alt.en),
"imageBlock": imageBlock {
"asset": asset->url,
"dimensions": asset->metadata.dimensions
},
},
This doesn’t work:
"content": coalesce(content[$lang], content.en) {
....,
_type == "pageImage" => {
...,
alt,
"imageBlock": imageBlock {
"asset": asset->url,
"dimensions": asset->metadata.dimensions
},
},
}
How would you query that?