I have a page, which uses a collection named blocks (Many-to-Any). Each of these blocks has multiple translated fields - so another relation called translations.
In my SDK-Api, I want to filter those translations to only return the results in the correct locale.
{
// page
id: 2,
blocks: [
// blocks collection
{
id: 1,
landing_id: 2,
collection: "block_hero",
item: {
id: 1,
translations: [
{
id: 1,
block_hero_id: 1,
languages_code: "de-de",
title: "German title"
},
{
id: 2,
block_hero_id: 1,
languages_code: "en-us",
title: "English title"
}
]
}
}
]
}
I already tried this, but it doesn’t work:
{
deep: {
blocks: {
item: {
translations: {
_filter: {
languages_code: {
_eq: "en-us"
}
}
}
}
}
}
}
All language versions are returned.
How do Filter for page.blocks.item.translations.languages_code === "en-us"?
Thank you!
I'd like to know this too !
– BlowsieDid you find a solution?
– BlowsieFor what its worth, I managed to acheive this just fine using graphQL, but couldnt get it to work with directus.request
– BlowsieDid anyone ever figure this out? I am currently also trying to query for translations by languages_code (using a singleton) and can't figure it out.
– learningburning