I usually run my query like this:
const x = await prisma.profile.findUnique({
where: { id: session.user.profileId }, include: { department: true }
})
This results in a nicely typed object and I am pretty happy. However my framework requires me to define the return type of that query "manually" in a .d.ts file. I saw there are some helpers for Prisma:
https://www.prisma.io/docs/orm/prisma-client/type-safety?query=payload&page=1#type-utilities
and
https://www.prisma.io/docs/orm/prisma-client/type-safety?query=payload&page=1#type-utilities
I played around with this, but no success. How can I "handcraft" the return type for the operation above?