Open anthonyhoegberg opened 2 weeks ago
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.
Hovewer, that feature is planned to be added to drizzle, and once that's out - I'll add it to drizzle-graphql
ASAP.
Waiting for the relational API v2 would be the easiest way to tackle this problem https://github.com/drizzle-team/drizzle-orm/discussions/2316
Right now would smth like this work as a hack? https://github.com/drizzle-team/drizzle-orm/discussions/1152
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
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