Skip to content

Commit 8eb35d6

Browse files
committed
fix: types not correctly inferred
1 parent d9de0f4 commit 8eb35d6

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function cache(opts: CacheOptions) {
9393
await db.set({ model, operation, args }, pack);
9494
}
9595

96-
return base;
96+
return base as BaseResult;
9797
};
9898
};
9999

src/types.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ export type ArgsWithCache<Type, Operation extends SupportedOperation> = Prisma.A
6969
export type ClientMethodWithCache<
7070
Type,
7171
Operation extends SupportedOperation,
72-
Args extends ArgsWithCache<Type, Operation>
73-
> = (this: Type, args?: Args) => Promise<Prisma.Result<Type, Operation, Args>>;
72+
Args extends Prisma.Exact<Type, Prisma.Args<Type, Operation>>
73+
> = (
74+
this: Type,
75+
args?: ArgsWithCache<Type, Operation>
76+
) => Promise<Prisma.Result<Type, Args, Operation>>;
7477

7578
/**
7679
* Supported operations for caching.

0 commit comments

Comments
 (0)