PrismaP
Prisma17mo ago
6 replies
Arthur

Return Type With Relations

Hello there,

I have a quick question about return type with relation. If I have this sort of query:

this.prismaService.loan.findFirst({
            where,
            include: {
                customer: true
            },
        });


So should Prisma's type have a customer as a return type?

import { Loan } from '@prisma/client';


If it is, why does it always crying that the customer is not a part of the type of loan?
Was this page helpful?