According to GraphQL.org/learn/queries/
A mutation can contain multiple fields, just like a query. Ther’s one important distincition between queries and mutation, other than the name:
While query fields are executed in parallel, mutation fields run in series, one after the other.
This means that if we send two
incrementCredits
mutations in one request, the first is guarenteed to finish before the second begins, ensuring that we don’t end up with a race condition with ourselves.
Is this from the spec or is this dependent on implementation?
I understand that mutations are processed in a single transaction, that is committed automatically. Is there any expansion on this to answer:
- Do all mutations in an operation run in the same transaction?
- Can mutations be separated into their own transactions?
- Does the order of mutations inside an operation effect any of the above?