Many to Many Query With

Pretty simply question. Many to Many relationships have "helper" tables. These simply relate the two tables together. Is there a way to ignore the helper tables in the query output? My current attempts just end up with: TS2353: Object literal may only specify known properties....
const result = yield* Effect.tryPromise(
() => db.query.pos.findFirst( {
where: (
pos,
{ eq }
) => (
eq( pos.id, id )
),
with: {
outlets: {
with: {
outlet: {
with: {
products: {
with: {
product: true
}
}
}
}
}
}
}
}
} )
)
const result = yield* Effect.tryPromise(
() => db.query.pos.findFirst( {
where: (
pos,
{ eq }
) => (
eq( pos.id, id )
),
with: {
outlets: {
with: {
outlet: {
with: {
products: {
with: {
product: true
}
}
}
}
}
}
}
}
} )
)
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server