Mutations documentation on errors seems to be wrong

Hi,

On this page:

We see this in the ‘Multiple fields in mutations’ section:

My understanding is that if a mutation fails as part of a multi-field mutation, then accepted mutations wouldn’t be rolled back, but that processing would wouldn’t continue. Have I misunderstood this, or do the docs need editing to make that clear?

EDIT: I meant to say “wouldn’t continue” not “would continue”.

Thanks.

I think you have misunderstood… A single mutation can have multiple “blocks”:

mutation {
    addFoo { ... }
    addBar { ... }
}

Both addFoo and addBar “blocks” are called mutation fields. Don’t @ me. It’s the GraphQL spec that calls it that way. I concur it’s a terrible name.

So if addFoo fails, addBar can still continue.

1 Like

Thanks for the reply.

I just realised that I wrote “would continue” when I meant “wouldn’t continue”. Sorry. This inverts the meaning of my question.

To clarify, what I’m referring to is this:

So, you’re saying is that if addFoo fails, addBar can still continue - but this doesn’t seem to agree with both what is said on graphql.org (above) and this discussion of transactions.

Does the serial processing of mutations refer to the fields, or perhaps multiple mutation blocks, like:

mutation {
  ...
}

mutation {
  ...
}

(if this is possible) or both?

Thanks.

I think it aborts the remaining mutation “fields” if one of them fails. At least from my experience.

@amaster507 - Thanks for confirming. That’s what I had thought.