You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found the issue when i started to create a custom resolver
my custom resolver use prisma from context attached to the generated typescript prismaClient
To see the typescript mismatches from any relationresolver.ts file output:
you can change
getPrismaFromContext(ctx).
to (getPrismaFromContext(ctx) as PrismaClient).
The original code use ctx.prisma in any so typescript is not working here
_count is not supported by the current generated typescript (completly different from the ts prisma code )
also cursor is not same (and need to be overriden to any )
my file ListingRelationsResolver.ts with error typescript on return
#204
So i use Promise<Omit<Category,"_count"> as a turnaround for the type output of this resolver.
for me this change turnaround typescript problems, also i tested _count and it s still working
From there it seems there is still some improvement todo to set the code fully compatible with prisma.
The text was updated successfully, but these errors were encountered:
where is required
a WhereInput have to be change to a WhereUniqueInput
and then no complain with typescript about upsert
Also in where we can even add Prisma.AtLeast to be even more near Prisma signature:
where: Prisma.AtLeast<CategoryWhereUniqueInput,"id"|"name"> | undefined;
and let inside file CategoryWhereUniqueInput id and name as optional with '?' to avoid an other complain
I found the issue when i started to create a custom resolver
my custom resolver use prisma from context attached to the generated typescript prismaClient
To see the typescript mismatches from any relationresolver.ts file output:
you can change
getPrismaFromContext(ctx).
to (getPrismaFromContext(ctx) as PrismaClient).
The original code use ctx.prisma in any so typescript is not working here
_count is not supported by the current generated typescript (completly different from the ts prisma code )
also cursor is not same (and need to be overriden to any )
my file ListingRelationsResolver.ts with error typescript on return
#204
So i use Promise<Omit<Category,"_count"> as a turnaround for the type output of this resolver.
for me this change turnaround typescript problems, also i tested _count and it s still working
From there it seems there is still some improvement todo to set the code fully compatible with prisma.
The text was updated successfully, but these errors were encountered: