Custom filters doesn’t apply for GraphQL collection query in API Platform

Custom filters doesn’t apply for GraphQL collection query in API Platform


0

I’m using API Platform and I want to add graphQL support and keep the same behavior between my REST calls and my graphQL calls. I have some custom filters for my get collection that works fine with REST, but they are not recognized in graphQL. According to the doc, I’ve added the following so graphQL now know that there is some filter on collection_query, but only appears on the schema and the doc, in fact theses filters are not taken.

 /** 
 * @ApiResource(
 *     graphql={
 *         "item_query",
 *         "collection_query"={
 *              "filters"={
 *                  PointFilter::class,
 *                  ShippingMethodFilter::class,
 *              }
 *          },
 *     }
 * )

I have also read here https://github.com/api-platform/core/issues/4615 that it’s "normal" because graphQL only send POST request and filters are applied on GET. Do you know if there is other options to make it work?


Load 5 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *