TRPC and PRISMA id type
Currently im trying to delete a object using id in prisma using trpc.
but im getting this error
Here is the schema
16 Replies
If you remove the .cuid from the input schema does it work? Seems like you can do input.id.somethingElse
Nope i tried
The input.id is a string
Id you hardcode a string does it work? Like go to your primes studio and copy the id
But id: is expecting a object idk why
Thats what im doing
I have a button to create a teacher
I get the teacher id
And then button to delete the teacher from id
I mean don’t use your schema input at all literally type
where: {
id: theIdYouGotFromPrismaStudioGoesHere
}
Just to see if that’s the issue at all
Ah
Same error
😭😭
Give me 15 minutes to be on my desk so I can try recreate this
Oh
Can you show where you are calling the mutation? This is a trpc error not a prisma one
Looks like you a doing
delete.mutate(id)
instead of
delete.mutate({id: id})
Im doing the first one yes
Its 6:20 am i just turned off my pc
Yeah that should be erroring in the code
Like at your editor
Alright then perfect ima do that when i wakeup in a few hours
If you remember drop a line on here just for closure
Ah u defo right
I remember following the chirp guide i think i just missed that
Wym
Like if this fixes the problem let us know here in case anyone else has something similar
worked 😎
Don’t forget to do this
Ok