Inner joining and left joining the same table (aliased) causes the return type to be never
I'm getting a weird issue where if I make two table aliases for the same table and then inner join one while left joining the other, the return type of my query ends up being
never[]
.
Unfortunately the type of data becomes:
I've reduced the Company table to the smallest it could possibly be but it makes absolutely no difference:
Interestingly, if both joins to the Company
table are left joins or if both joins are inner joins, it works fine, but that's not my intended behavior.
What am I missing here? 🤔3 Replies
Another note is that, types aside, my query works as intended with one inner join and one left join.
Having the exact same error! Did you find a solution for it? It seems that it does work in runtime, so the sql is generated correctly, but the types are
never[]
.
I fixed it by just leftJoin
ing both aliases.Unfortunately had to do the same.