Skip to content
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

Filters on relationships #522

Closed
devexsolutions opened this issue May 28, 2021 · 4 comments
Closed

Filters on relationships #522

devexsolutions opened this issue May 28, 2021 · 4 comments

Comments

@devexsolutions
Copy link

Hi, how can I apply filters on relationships?

GET /comments?filter[post]=1,2&filter[author]=12 HTTP/1.1

Thanks

@alkhachatryan
Copy link

The same question from me.

@matthewtrask
Copy link
Contributor

Fractal is a serializer and data transformer, so it doesn't really look at what you are passing to the request. You would need to handle the filter in your own code and then conditionally handle the data being sent to your transformer.

@willishq
Copy link
Member

I agree, however I think in the documentation there is a reference to the querystring being used to parse includes, which could cause some confusion.

Maybe we need to change the documentation to be explicit that Fractal does not choose what data you pass to it (such as posts with a specific ID or Author) and instead manages on how to display the data passed to it.

Interestingly, as an aside, I did try to solve this problem 3 years ago with a package I called query-grid, however the concept is pretty complex and it's probably easier to write things like filtering by hand per use-case rather than try to create a catch-all package.

@matthewtrask
Copy link
Contributor

Im going to close this for now, but if this is still a persistent issue please feel free to reopen.

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

No branches or pull requests

4 participants