# Mutations documentation on errors seems to be wrong

**URL:** <https://discuss.dgraph.io/t/mutations-documentation-on-errors-seems-to-be-wrong/13782>\
**Category:** Dgraph\
**Created:** [April 19, 2021, 10:35am UTC](https://discuss.dgraph.io/t/mutations-documentation-on-errors-seems-to-be-wrong/13782 "2021-04-19T10:35:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugaia](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@eugaia](https://discuss.dgraph.io/u/eugaia)\
**Post date:** [April 19, 2021, 10:35am UTC](https://discuss.dgraph.io/t/mutations-documentation-on-errors-seems-to-be-wrong/13782/1 "2021-04-19T10:35:09Z")

</div>

Hi,

On this page:

> **[Mutations Overview - GraphQL](https://dgraph.io/docs/graphql/mutations/mutations-overview/)**
>
> Mutations can be used to insert, update, or delete data. Dgraph automatically generates GraphQL mutation for each type that you define in your schema.

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

> [@](#):
>
> If one of the mutations is aborted due error like transaction conflict, we continue performing the next mutations.

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.

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [April 20, 2021, 4:04am UTC](https://discuss.dgraph.io/t/mutations-documentation-on-errors-seems-to-be-wrong/13782/3 "2021-04-20T04:04:16Z")

</div>

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

```auto
mutation {
    addFoo { ... }
    addBar { ... }
}

```

Both `addFoo` and `addBar` “blocks” are called mutation fields. Don’t @ me. It’s [the GraphQL spec](https://graphql.org/learn/queries/) that calls it that way. I concur it’s a terrible name.

So if `addFoo` fails, `addBar` can still continue.

---

<div class="post-metadata">

**Author:** ![eugaia](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@eugaia](https://discuss.dgraph.io/u/eugaia)\
**Post date:** [April 20, 2021, 8:40am UTC](https://discuss.dgraph.io/t/mutations-documentation-on-errors-seems-to-be-wrong/13782/4 "2021-04-20T08:40:15Z")

</div>

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:

> **[Queries and Mutations | GraphQL](https://graphql.org/learn/queries/#multiple-fields-in-mutations)**
>
> A query language for your API — GraphQL provides a complete description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer...

> [@](#):
>
> ### Multiple fields in mutations
> 
> A mutation can contain multiple fields, just like a query. There’s one important distinction between queries and mutations, 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 guaranteed to finish before the second begins, ensuring that we don’t end up with a race condition with ourselves.

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](http://graphql.org) (above) and [this discussion of transactions](http://discuss.hypermode.com/t/transactions-in-graphql/6861).

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

```auto
mutation {
  ...
}

mutation {
  ...
}

```

(if this is possible) or both?

Thanks.

---

<div class="post-metadata">

**Author:** ![amaster507](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/amaster507/32/4123_2.png) [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Post date:** [April 20, 2021, 2:28pm UTC](https://discuss.dgraph.io/t/mutations-documentation-on-errors-seems-to-be-wrong/13782/5 "2021-04-20T14:28:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eugaia](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@eugaia](https://discuss.dgraph.io/u/eugaia)\
**Post date:** [April 20, 2021, 2:32pm UTC](https://discuss.dgraph.io/t/mutations-documentation-on-errors-seems-to-be-wrong/13782/6 "2021-04-20T14:32:18Z")

</div>

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