I'm using JSON API and JSON API Include modules, in Drupal 9.5
I've got a node type, "article" with a entity reference revisions field referencing a paragraphs, field name, field_variant.
So this call works great, gives me all information: https://mysite.com/jsonapi/node/article?include=field_variant&jsonapi_include=1
What I'd like to do is have a filter, which returns all nodes of the type, that have a particular value for a field on one of the paragraph entities, BUT, only include the paragraph entities with that value.
So imagine the paragraph type has field_hide, boolean.
Node has two paragraph items.
I set field_hide = 1 for one item, and field_hide = 0 for the other item.
Now I want to do something like this:
https://mysite.com/jsonapi/node/article?include=field_variant&jsonapi_include=1&filter[field_variant.field_hide]=0
I want this to return the node and all its fields, but in the include for the paragraph field, field_variant, only return the paragraph item where field_hide = 0.
Currently if even 1 paragraph item has the filter value, then the node and ALL its referenced paragraph items are returned in the response.
How to limit the list of referenced paragraph items so that only those items that match the paragraph field's filter are included in the result?