We solved it over here: https://github.com/prisma/prisma/discussions/3893
TL;DR
export const productsInCategory = async ({ categoryId }) => {
const productsOfCategory = await db.category
.findOne({
where: { id: categoryId },
})
.CategoryToSimpleProduct({
select: { simpleProduct: true },
})
return productsOfCategory.map(wrapped => wrapped.simpleProduct)
}