Open JoeRoddy opened 1 month ago
Hello @JoeRoddy , I'm not surprised this is happening, we don't throw error yet in Prismock
(including foreign key, duplicate, etc.). While Prismock
is now in a state where we could add those errors, I don't plan to implement it short-term.
On another hand, this does not completely look like it's only about supporting errors, the nested where clauses should return no data, hence no update should occur.... I'll still have a look
Again, great work on this library! It is massively valuable!
We're running into an issue with prismock not enforcing an AND clause in nested updates. (It might also have something to do with nesting some's and OR's inside of it)
Imagine a schema with user groups, and groupRoles for permissions. Psuedocode, but I think you'll get the idea
We run the following code:
The
AND
clause in question may look odd (nesting AND, OR, some, etc), but changing it is not really an option. The query is dynamically build by our Authorization library CaslWhen we run the above code with Prisma, we get an error (desired behavior):
When we run it with Prismock, there is no error, and we're able to validate that the update persisted. (undesired, inconsistent wiht Prisma)