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
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            } )
        )
Was this page helpful?