.filterWhere inference
I have this in a select
The result is being inferred as
{ id: string | null; label: string | null }[]
Shouldn't it be { id: string; label: string }[]
?6 Replies
Hey 👋
Due to type complexity and performance filtering methods do not affect the output type.
Ah. I see.
But how do I remove the null manually. I've used
.$notNull
and it results in interests
being any
Solution
You can use
.$narrowType
for this.Gotcha. Will check it out
Also, that
sql
template tag should be given an output type manually.Thank you. Typing the
sql
tag fixed it.