Typing reusable functions for filtering rows
Hi all, we're using Kysely at our company and loving it! We recently encountered some issues when trying to type reusable functions.
One example of our current attempt:
This works when our initial query is basic like this:
However, it stops working when we add some joins (which shouldn't break the original filtering function anyway):
If we update the SelectQueryBuilder middle type to be
"conversations" | "contactConversations"
, it works with neither the simpler, nor the more "complex" query.
I'd be thankful for any pointers and general tips on how to type reusable functions!3 Replies
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Right, thanks! But how do we type the function to accept SelectQueryBuilder in a flexible manner?
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View