GraphQL Fix: Apply filters to collection queries
| Q | A |
|---|---|
| Branch? | 2.6 |
| Tickets | https://github.com/api-platform/core/issues/4615 |
| License | MIT |
| Doc PR | none, bug fix |
Problem
Custom filters extending ApiPlatform\Core\Serializer\Filter\FilterInterface are applied in REST but not GraphQL when using a custom data provider (i.e. not Doctrine). Specifically, the FilterInterface::apply() method does not seem to be called.
Fix
Adds code to collect the filters in GraphQL similar to how they are collected in REST and call the apply() method of each filter.
Closes https://github.com/api-platform/core/issues/4615
@alanpoulain @lukasluecke @ollietb Sorry to bother but I would appreciate some quick feedback on this PR. It's been about a month now.
Hello, Sorry for this. I will try to review the pending PR when API Platform 2.7/3 is out. Merging PR in our current state creates a lot of burden for maintainers.
@alanpoulain @lukasluecke @ollietb please take another look at this. This fixes a major bug in a core feature of api-platform's graphql support. The next release really shouldn't go out without this fix if you are claiming to support graphql. My team is in the middle of implementing api-platform, which we chose for its graphql support, but our project is currently stalled on this bug. Thanks for your time and your effort on this project.
I think the test failures are unrelated, given that other PR's for 2.6 seem to be failing them as well (e.g. https://github.com/api-platform/core/pull/4762)
Closing because https://github.com/api-platform/core/issues/4615 is resolved