-
-
Notifications
You must be signed in to change notification settings - Fork 854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search Filter does not filter collection by nested relation field in GraphQL #1714
Comments
+1 |
mneuhaus
pushed a commit
to mneuhaus/core
that referenced
this issue
Mar 2, 2018
GraphQL filter properties use a underscore instead of dot to seperate nested fields, which causes some issues like api-platform#1714 where nested filters are not applied. This change replaces the underscore with a dot in the AbstractContextAwareFilter to have one commen syntax further down. closes api-platform#1714
Can confirm that #1743 fixes this issue. |
antograssiot
added a commit
to antograssiot/core
that referenced
this issue
Apr 15, 2018
antograssiot
added a commit
to antograssiot/core
that referenced
this issue
Apr 15, 2018
dunglas
pushed a commit
that referenced
this issue
Apr 20, 2018
teohhanhui
pushed a commit
to teohhanhui/api-platform-core
that referenced
this issue
May 2, 2018
* Allow GraphQL to filter on nested property fixes api-platform#1714, api-platform#1867 * Allow ordering on nested property values
teohhanhui
pushed a commit
to teohhanhui/api-platform-core
that referenced
this issue
May 2, 2018
* Allow GraphQL to filter on nested property fixes api-platform#1714, api-platform#1867 * Allow ordering on nested property values
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
I've been recently testing GraphQL endpoint provided by this amazing framework.
So I've encountered on follwing SearchFilter issue.
I've following entities (simplified):
and I've declared following filters (old way):
Filter works fine using normal REST:
GET /articles?category.code=news&group[]=CategoryRead
but using GraphQL:
GET /graphql?query={articles(category_code:"news"){edges{node{category{code}}}}}
It returns an unfiltered collection:
I've tried also new way via annotation:
but the behaviour is exactly the same, in REST context works in GraphQL it does not.
I've checked and filtering works for not nested fields.
Stack:
Here I provide my test api endpoints, with symfony profiler enabled, so you can see the details, hope it helps:
REST
https://knit-test-api.tk/articles?category.code=news&group%5B%5D=CategoryRead
GraphQL:
https://knit-test-api.tk/graphql?query={articles(category_code:%22news%22){edges{node{category{code}}}}}
Travis CI build with feature tests:
https://travis-ci.org/knit-pk/api-v1-php/jobs/343330287#L708
Git branch (full codebase):
https://github.com/knit-pk/api-v1-php/tree/feature/graphql-filters-test
Thanks for your time.
PS: I appreciate your work very much, and really enjoy developing an API with API Platform!
The text was updated successfully, but these errors were encountered: