Nested Relations Where has Zero Typings :confused:

Hey guys - first post so please let me know if this isn't the wrong place or I'm doing something wrong. Anyhow, I'm trying to order a simple nested relation in a query:

await db.query.channel.findMany({
    with: {
        pins: {
            orderBy: (pin, { desc }) => [desc(pin.createdAt)]
        }
    }
});


Now - the with has no typings at all, so I have to hand craft the query with zero type annotations. There's also an issue of the desc binding element being implicitly of type any also, but that's for another day.

Has anybody come across this, and if so - is there a fix.. Or, more likely - am I doing something wrong, that isn't meant to be done this way?
Screenshot_2023-08-27_at_23.05.40.png
Was this page helpful?