P
Prisma2mo ago
mrjfrcdo

How to dynamically get relationships of a from a wrapper function?

I have a function that only returns the value of prisma like so:
findUniqueOrThrow(args: Prisma.SomethingFindUniqueOrThrowArgs) {
return this.prismaService.something.findUniqueOrThrow(args);
}
findUniqueOrThrow(args: Prisma.SomethingFindUniqueOrThrowArgs) {
return this.prismaService.something.findUniqueOrThrow(args);
}
but when I try to use it like this. I cannot access the rest of the models.
const something = findUniqueOrThrow({
id: 1,
include: {
somethingElse: true,
},
});

// something.somethingElse cannot be found by typescript.
const something = findUniqueOrThrow({
id: 1,
include: {
somethingElse: true,
},
});

// something.somethingElse cannot be found by typescript.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server