GraphQL WHERE clause on array field returns all items in array #428
Replies: 2 comments
-
Hey @criticalmaas — thank you for bringing this up. I think this is working as expected right now, because the first document in your returned results does have a Although:
This is totally possible. It would be a GraphQL-only feature, of course, but it's certainly doable. The bulk of the work would be to convert our database query syntax into something to be used in GraphQL resolvers on POJOs, which could end up being useful elsewhere as well. If you're interested in pursuing this feature request, I suggest we close this issue and take the conversation to a new Feature Request Discussion where we can talk through the approach in further depth. This new feature could also be applied to the What do you think? |
Beta Was this translation helpful? Give feedback.
-
Hi @jmikrut, Firstly thanks for putting together such an awesome headless CMS framework! I was having a think about a solution to this problem and thought perhaps we could look at using Below is an example of what the query might look like:
What do you think? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug Report
When using GraphQL with a collection that contains an array, when using the where clause on an array field which is of type
checkbox
orselect
, the result is that all items in the array are returnedExpected Behavior
When using the where clause, only the items in the array that match the where condition should be returned. Or alternatively, can a where condition be supported on the nested array portion of the query?
Current Behavior
Possible Solution
Steps to Reproduce
Detailed Description
collection fields:
sample query
response:
payload v0.13.3
browser: chrome latest
Beta Was this translation helpful? Give feedback.
All reactions