P
Prisma2mo ago
powerkuu

How can i get the change the return type of a prisma function based on a generic type?

This code works, but if I change the include parameter it doesn't get reflected in the return type of "prisma.user.findFirst". I know this is more of a typescript question but maybe some of you guys have solved this before?
export async function verifyAuth<I extends Prisma.UserInclude>(token: string, include?: I) {
return prisma.user.findFirst({
where: {
token
},

include: include
})
}
export async function verifyAuth<I extends Prisma.UserInclude>(token: string, include?: I) {
return prisma.user.findFirst({
where: {
token
},

include: include
})
}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server