hi, wondering how do i cast a variable from any to...
# prisma-client
j
hi, wondering how do i cast a variable from any to Model that i could retrieve the relationship from the original query? i have a streaming function that return the model, but it becomes unknown type
for example
Copy code
const x = y as User
console.log('add', x.Address?.name)
r
Is the
Address
a relation to
User
? And how is
y
fetched in this case?
j
hi nvm, i found the answer, User & { Address: Address }