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
constselect=newPrismaSelect(info).value// `foo` does not exist in my model so I want to have a TypeScript error hereawaitprisma.user.findUnique({where: {id: '123',foo: 42}, ...select})
In the above code I don't get an error, even though the field foo does not exist in my model. That's because select is typed as any, so the spread of ...select makes the whole object any.
If I change the first line to :
Hi,
It's easier to explain with an example :
In the above code I don't get an error, even though the field
foo
does not exist in my model. That's becauseselect
is typed asany
, so the spread of...select
makes the whole objectany
.If I change the first line to :
I get the error on
foo
as expected.So I suggest that
new PrismaSelect(info).value
should returnRecord<string, unknown>
by default.The text was updated successfully, but these errors were encountered: