Cant query with relation using query method
Hi Guys
I facing a challenge where when i query and try to pull out the data from referenced table, it says TypeError: Cannot read properties of undefined (reading 'referencedTable')
here is my schema relations:
here is my query in sveltekit +page.server.ts
some facts
1. if i remove the with property:true, it's working but i can't get the data in property table
2. i try to double query and join it manually in the code, but not working because the 2nd query that query to the table separately is only able to filter it using single data, which i will have multiple property rows
5 Replies
it's not giving me type checking error, which is weird
Just realized that in the schema.ts im using roon_type for the name, and i should use property instead
This is solved
OP, sorry for necroing this post,
but I'm also having trouble with the include relations query, what should be the property inside the with object ?
my relation is declared like the following
and here's the query
i've also tried to change the
with
object to {users:true}
but still receiving the referencedTable
errorHello, @Vigne! What do you want to achieve with your query? As I see, your query is valid, you get many events and one related user to them (host).
ah sorry, i forgot to informing about this, it turns out that I have to add the relations variables when creating initializing the drizzle
it's been solved now