# Should BatchHttpLink exclude mutations by default?

**URL:** <https://community.apollographql.com/t/should-batchhttplink-exclude-mutations-by-default/10058>\
**Category:** Client SDKs\
**Tags:** client, web\
**Created:** [September 14, 2026, 10:36pm UTC](https://community.apollographql.com/t/should-batchhttplink-exclude-mutations-by-default/10058 "2026-09-14T22:36:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![markl](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/markl/32/1171_2.png) [@markl](https://community.apollographql.com/u/markl)\
**Post date:** [September 14, 2026, 10:36pm UTC](https://community.apollographql.com/t/should-batchhttplink-exclude-mutations-by-default/10058/1 "2026-09-14T22:36:22Z")

</div>

BatchHttpLink’s default batchKey function does not distinguish between queries and mutations. Both get grouped into the same batch. I understand that in theory it’s a valid transport level optimization since the server always executes mutations in serial. however…

1. executing operations in batch is unspecified behavior. is there a risk that a federation router may send mutations to different upstream services to execute in parallel

2. it seems like a large risk of stale data / race conditions / confusing states is large (e.g. [Auto-refetch has a race-condition with the mutation and request batching is broken · Issue #11219 · apollographql/apollo-client · GitHub](https://github.com/apollographql/apollo-client/issues/11219) ) to the point where having batching disabled for mutations as a default seems worthwhile

---

<div class="post-metadata">

**Author:** ![jerelmiller](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/jerelmiller/32/3314_2.png) [@jerelmiller](https://community.apollographql.com/u/jerelmiller)\
**Post date:** [September 15, 2026, 6:04pm UTC](https://community.apollographql.com/t/should-batchhttplink-exclude-mutations-by-default/10058/2 "2026-09-15T18:04:29Z")

</div>

Hey @markl 👋

Let me get back to you on how Apollo Router handles batching mutations so I can get you accurate info.

I can see an argument for wanting to turn off batch mutations. Let me think about this a bit. We might be able to add an option for this in `BatchHttpLink`, but I’ll see how router handles it first.

---

<div class="post-metadata">

**Author:** ![jerelmiller](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/jerelmiller/32/3314_2.png) [@jerelmiller](https://community.apollographql.com/u/jerelmiller)\
**Post date:** [September 16, 2026, 5:01pm UTC](https://community.apollographql.com/t/should-batchhttplink-exclude-mutations-by-default/10058/3 "2026-09-16T17:01:54Z")

</div>

I got confirmation that router batch executes mutations in parallel, so you’re correct. That said, the more I think about it, does batching really change anything if you have mutations that depend on others? Even if you turned off batching for mutations, sending multiple mutations to the server could still result in out-of-order execution of those mutations right? The safest thing would be to execute serially at the call site:

```typescript
await mutation(mutation1)
await mutations(mutation2)
// etc

```

---

<div class="post-metadata">

**Author:** ![markl](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/markl/32/1171_2.png) [@markl](https://community.apollographql.com/u/markl)\
**Post date:** [September 17, 2026, 5:07pm UTC](https://community.apollographql.com/t/should-batchhttplink-exclude-mutations-by-default/10058/4 "2026-09-17T17:07:33Z")

</div>

@jerelmiller thanks for the response!

From my teammate:

> In this case, our mutations don’t depend on each other - we just want to fire them off at the same time. The batching behavior is annoying because network failures from one of the mutations can corrupt the other one or slow it down. So less to do with the race conditiony stuff and more the inherent limitations of using one network req for two operations
> 
> the nature of what mutations are doing leads to them wanting to be independent reqs, IMO
> 
> error recovery is almost always happening at an individual mutation level, not a batch level

so i think tl;dr while technically a valid optimization strictly for performance, for us at least, it’s more often desirable to disable batching than enabling for mutations

---

<div class="post-metadata">

**Author:** ![jerelmiller](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/jerelmiller/32/3314_2.png) [@jerelmiller](https://community.apollographql.com/u/jerelmiller)\
**Post date:** [September 17, 2026, 5:15pm UTC](https://community.apollographql.com/t/should-batchhttplink-exclude-mutations-by-default/10058/5 "2026-09-17T17:15:41Z")

</div>

> because network failures from one of the mutations can corrupt the other one or slow it down

Ah this makes a lot of sense. Let me talk with the team to see if it makes sense to introduce a new option for `BatchHttpLink` that would let you disable batch mutations by default. Thanks!
