Planetscale many to many query relation wrong return value #1899
Unanswered
Adam-Collier
asked this question in
Q&A
Replies: 1 comment
-
This is correct behavior. But you can obtain the tag that you need using: const res = await db.query.bookmark.findMany({
with: {
tags: {
with {
tag: true
},
},
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone, I was playing around with Drizzle last night and I ran into an issue when creating a many to many relation and querying the relation. When I query like the below:
I get this response:
see how tags are just pulling in the junction table row rather than the tags itself, I have no clue what is happening here as I would expect the tags to be pulled in correctly. As far as I'm aware I followed the docs correctly (bar omitting the references in the junction table since I'm not using foreign keys in planetscale) I'll post the schema I have below and hopefully one of you kind folks can point me in the right direction:
Also apologies on how long this got
Beta Was this translation helpful? Give feedback.
All reactions