Validator questions
I'm trying to operate partial type of my User model as I omit the passwordHash field at instantiation. When I follow the docs I end up with the
select
included in the type, this is from my sveltekit app:
Property 'givenName' does not exist on type '{ select: { email: true; givenName: true; }; }'.ts(2339)
Solution:Jump to solution
Can you try this code?
```js
import { Prisma } from '@prisma/client'
const partialUser = Prisma.validator<Prisma.UserDefaultArgs>()({...
5 Replies
Hi @Uncle 👋
Can you please share the User model? Does
givenName
field exist on the User
model?my User model:
My client instantiation
Solution
Can you try this code?
You may need regenerate your Prisma client or restart your typescript server in your IDE
hello. try it like this
i didn't see you already answered Raphael. sry 😅
i copy pasted from another question i answered that was asking about the same thing
That worked. Can somebody explain what I was missing / why that worked?
Thanks by the way