Argument `where` of type *WhereUniqueInput needs at least one of `id` arguments.
No TS or linting warnings, and yet I am running into a problem with a simple update query.
Relevant query:
Log of input provided to query before calling it:
Log of error:
Even inside the error thrown, it is apparent that an id is indeed being passed. I'm not sure where to go from here, it seems very simple so maybe I'm missing something?
Solution:Jump to solution
after digging on how to enable debug logs for prisma, i found out that it was another query responsible.
7 Replies
just in case this is helpful
Hey @b0ngl0rd 👋
What is the value of
table
variable here?
Is the value of table this: [ { id: 57, relief: { id: 201 }, dealer: null } ]
?It's the object inside that array, yes. In the bigger picture, this is a piece of a transaction, hence the array. However, the error points to this exact query.
Can you share the
dealer
model?
so it turns out that prisma won't always return the correct query responsible for throwing an error when processing a transaction.
Solution
after digging on how to enable debug logs for prisma, i found out that it was another query responsible.
is the cause. so this is because i misunderstood the docs or something on how to make a query optional.
looks like prisma only reports the first in the batch as the problem, when it could be any of them.