Hi everyone. I couldn't find the answer to this qu...
# orm-help
n
Hi everyone. I couldn't find the answer to this question online, maybe someone knows... If I issue multiple mutation to prisma in a single push, as in :
mutation {
q1: updateMyObject(...){...},
q2: updateMyOtherObject(...){...}
}
Do Prisma guarantee the order of execution and transaction all the queries (ie, if q2 fails for some reason, would q1 be rollbacked ?) I know GraphQL server are supposed to guarantee the order of action when receiving multiple mutations, and I read that Prisma mutation are atomic (though that article could refer to nested mutation too...), but if anyone has a more direct prisma-related knowledge on this case, I'd be grateful... Thanks for any info !
👍 1
m
The mutation q2 will be executed after mutation q1. But q1 will not be rolled backed if q2 fails. This behaviour is mandated by the GraphQL spec as those mutations shall be treated independently. However we understand that concern and are thinking about wrapping both mutations in a single transaction.
👍 1
n
Thanks for the quick reply 🙂
Do you know if they would at least go through the same JDBC connection (I'm using the PGSQL connector) ? In this case, would it be possible to raw-execute BEGIN, perform the mutations, then raw-execute COMMIT ?