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
You basically need to unwrap and rewrap the PrismaClient constructor so you can modify the returned instance type. There might be a more elegant way of doing this, but this is working for me:
Problem
This type cast is incorrect:
prismock/src/lib/client.ts
Line 116 in 1b3baeb
It's intersecting the
PrismockData
interface as a static interface, not an instance interface.What I mean by that is that with the current types, this is a type error (but not a run-time error):
while this is not a type error but is a run-time error:
Solution
You basically need to unwrap and rewrap the
PrismaClient
constructor so you can modify the returned instance type. There might be a more elegant way of doing this, but this is working for me:Note that if you don't want to include the
type-fest
dependency, theConstructor
type that it exports is as follows:The text was updated successfully, but these errors were encountered: