How to create a reusable query that can receive different select values?
I have a query with a lot of filters and ordering logic that I want to reuse but with different selects across a few endpoints, something like this:
But I don't know how to type the select correctly.
When I do this anything after the left join becomes a type error:

2 Replies
The problem is that you are using spread operator. use
and(filters)I've tried that and that's not the issue.
The error is also saying that
where property does not exist.