Prisma client: type of table

Viewed 39

I'm building an application with nestjs and wanna inject only a part of prisma api. So what's the type of the prisma.table (prisma.tag) that I'm injecting?

export class TagService {
    private readonly tagApi; // what's the correct type of `tagApi`
    private readonly tagApi: Prisma.TagDelegate<Prisma.RejectOnNotFound | Prisma.RejectPerOperation>; // type that is inferred by vscode


    constructor(prisma: PrismaService) {
        this.tagApi = prisma.tag;
    }

    exampleUsageMethod(tagId: string) {
        return this.tagApi.findMany({ where: { id: tagId } });
    }
}
0 Answers
Related