You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
To Reproduce
Have a document with a field (textfield, checkbox or something that makes for an easy where selection) that has localized set to true and another field (like a text field) also with localized set to true just for content.
Have at least two locales configured and for one of them the document has data (fields are filled out), for the other it does not.
Specify the GraphQL query to fallback to the locale where data was entered.
Query for the document with the locale that does not have data, also specifying that one of the documents fields needs to have a certain value with the where clause (easiest would be a checkbox boolean value like in my case).
Even though the document in the fallback locale contains the appropriate value no documents are returned.
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)
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?
Link to reproduction
No response
Describe the Bug
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.
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.
To Reproduce
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)
Payload Version
2.13.0
Adapters and Plugins
db-mongodb, bundler-webpack, plugin-cloud-storage, richtext-lexical, translator-plugin
The text was updated successfully, but these errors were encountered: