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
james tan
08/17/2021, 9:21 AM
for example
Copy code
const x = y as User
console.log('add', x.Address?.name)
r
Ryan
08/18/2021, 4:36 AM
Is the
Address
a relation to
User
? And how is
y
fetched in this case?
j
james tan
10/03/2021, 6:32 AM
hi nvm, i found the answer, User & { Address: Address }