No response
When having a GraphQL Query that has a fallbackLocale specified and using a where clause to filter for specific checkbox value (in this case) the where selector does not work properly on the specified fallbackLocale.
fallbackLocale: en_DE
limit: 500
where: { showInOverview: { equals: true } }
Here I fallback to a locale where at least one document has the showInOverview value set to true. When querying directly for the locale en_DE this does indeed deliver the proper results.
When querying for a locale that does not yet have any data and falling back to en_DE the where operation has the consequence that no documents are found. When removing the where clause the expected data from the en_DE fallback locale is delivered.
After further investigation: (edited the reproduction steps as well)
I found that for a slug text field that I have in the document it works properly but with another title text field it does not work.
The only difference between the fields:
The title is required and localized. The slug is neither.
The showInOverview field is also localized and required. This might have something to do with the fact that the field I select for in the query is localized 🤔 (I would suspect that rather than the required prop)
2.13.0
db-mongodb, bundler-webpack, plugin-cloud-storage, richtext-lexical, translator-plugin
Hey @STR1234 — this is expected actually. We can't query for multiple locales at once because that would require some performance overhead. We only query in the locale that you have specified (or the default locale).
You might want to find another pattern if you will be querying on this field often. Maybe specify the field separately once per locale?
Thank you @jmikrut for the clarification 🙌 I will look into another pattern but intuitively I expect a different behaviour - maybe I can propose additions to the documentation to make the expected behaviour clearer or I might have missed something in the docs that already explains this.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.