Ordering by relation in relational query

I am trying to sort on an attribute of a relation using the relational queries api, but as far as I can tell it is not supported?

Example:
await db.query.city.findMany({
    orderBy: (country    , { asc }) => [asc(country.name)],
    with: {
        country: true,
    },
});


Thanks,
J
Was this page helpful?