.update return null when data is found using .findUnique using the same where clause (version 5.17.
How is this even possible ?
my updatedUser is null, and no updated has been performed
But the data exist since the user is found successfully
no error is thrown by prisma just updatedUser being null
with console loggin
User not found or update failed transactionId
3 Replies
@🔨 Moderator @aqrln @Jon Harrell
Would love to get your thoughts on this puzzle
Been using prisma for 2 years now, and first time not being able to understand this issue
I had the same issue before. Solved using AND operator in both queries.
BTW, set export DEBUG="*" and you could see query differences by yourself.
I ended up finding the issue
Basically our schema was not applied correctly because we were using
raw queries (create) in one tiny area in the code base
causing thoses records to not complie at all with the prisma schema, even if we used the same data type etc..
For prisma they dont exist even thought they are here
So my recommendation would be to avoid using raw query for input data at all cost