Prisma Select TypeError
ok - my issue might be unrelated:
This works:
This does not:
When i move the select param to the bottom after a multiple nested relation lookup, it throws errors for the nested relation's properties. Why?
4 Replies
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the
#ask-ai
channel awaits if you're curious!Hey ð
What happens if you do something like this?
Does the order of select still cause issues for you?
yes, that was one of the first things i tried. Still causes issues. Its something to do with the relation nested select bit. I can put my
select
using type declaration anywhere above the following bit and not have problems:
But if it goes anywhere after it, it causes errors in the Baz level of the results (specifically that property Baz
on foo.Bar
does not exist. If i put the select before that bit, no errors ðĪŠis this not just because when spreading object keys only get merged on level deep (and so types do too?)
if the second object can have select.Baz be undefined it doesn't matter if select.Baz.select is defined in the first object you spread, it will still be typed as optional
so maybe missing smth but this makes sense to me ð