Hey,
Let’s assuming my model has a localized string field called myLocalizedField
with 2 locales: locale1
, locale2
where locale1
is the default one.
Is there a way to find a record where myLocalizedField
has either myLocalizedField[locale1] or myLocalizedField[locale2] that match with a value?
Here is where I ended up if myLocalizedField[locale1]
is equal to foo
and myLocalizedField[locale2]
is equal to bar
query withoutLocale {
form(filter: { myLocalizedField: {eq: "foo"}}) {
fieldA
}
}
=> record found as myLocalizedField[locale1] = foo
query withLocale {
form(filter: {myLocalizedField: {eq: "foo"}}, locale: locale2) {
fieldA
}
}
=> record not found as myLocalizedField[locale2] = bar
Having said that, I don’t want to loop on each locale to find the right record.
I will appreciate any hints on this