Skip to content

Describe how to filter on nested properties with GraphQL #472

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

Merged
merged 2 commits into from
Apr 25, 2018

Conversation

antograssiot
Copy link
Contributor

@antograssiot antograssiot commented Apr 24, 2018

@@ -508,7 +508,7 @@ use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
/**
* @ApiResource
* @ApiFilter(OrderFilter::class, properties={"product.releaseDate"})
* @ApiFilter(SearchFilter::class, properties={"product.name": "exact"})
* @ApiFilter(SearchFilter::class, properties={"product.color": "exact"})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dunglas the actual example is off.

just bellow it states The above allows you to find offers by their respective product's color: http://localhost:8000/api/offers?product.color=red 

core/graphql.md Outdated
The above allows you to find offers by their respective product's color like for the REST Api.
You can then filter using the folowing syntax:

```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use ```graphql do enable syntax highlighting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update tonight 👍

core/graphql.md Outdated

Or order your results like:

```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sale here

@antograssiot
Copy link
Contributor Author

all set as requested @dunglas

@dunglas dunglas merged commit 39b9ba8 into api-platform:2.2 Apr 25, 2018
@dunglas
Copy link
Member

dunglas commented Apr 25, 2018

Thanks @antograssiot

@antograssiot antograssiot deleted the graphql-filters branch April 25, 2018 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants