-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add where filter for relational objects aswell? #13
Comments
Offset, limit & order by are excluded from "one" type relations, since applying them to an already single record makes no sense. If they're absent from "many" relations too, I'm going to need your schema to investigate the issue. As for filtering by values of relations, I'll see what I can do, currently my filters are duplicate of drizzle's RQB filters, and I'm not sure whether that would be possible to make with the way the drizzle rqb works. |
I see the offset thing was my miss, that's correct However approaching the sort from the other end wouldn't work in my case since I'm filtering both the main object and the sub object so the issue persists there, could we add a specific custom filter for relational objects only maybe? |
I did some investigation of current Drizzle RQB API, and conclusion is that it is impossible to implement this feature now. |
Waiting for the relational API v2 would be the easiest way to tackle this problem Right now would smth like this work as a hack? |
While it could work, implementing this would be a nightmare and could quite possibly take me more time than it is left to wait for RQBv2 |
Could this possibly be done in the mean time with like a filter after getting the data from the database on the backend side? to simulate the new relational api until it comes out. I find myself working around a lot of issues to get it to work somewhat on the client side |
You could actually reuse a type and add a wrapper around it's generated resolver with filters for that, but I don't really see a point of adding such functionality to the library right now as it does not get mapped to a DB query |
Right now we can only do where filters on properties of objects
But being able to filter on relations aswell would be nice bc we could do the following:
Right now even if we would filter the comments, we would still get all users that does not have a comment that equals test, so we would get a list of all usernames including those without the test comment
We could inverse the query and go from comments where it equals test and the including users inside of that as reference to parent object, but in some circumstances that does not make sense. (like having other filters on the user object itself)
EDIT:
Its also currently not possible to limit/offset relational objects only where for its sub properties
The text was updated successfully, but these errors were encountered: