---
searchable: false
---

import { Callout } from '@theguild/components'

# Upstream Cancellation

This feature enables you to cancel the upstream HTTP requests when the client cancels the downstream
GraphQL request. This can be useful when you want to save resources on your server and the services.

There is also
[Execution Cancellation](/docs/gateway/other-features/performance/execution-cancellation) that stops
the execution, but it doesn't stop ongoing HTTP requests. This seperately allows you to stop the
HTTP requests by hooking into [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).

## Enable Upstream Cancellation

```ts filename="gateway.config.ts"
import { defineConfig } from '@graphql-hive/gateway'

export const gatewayConfig = defineConfig({
  upstreamCancellation: true
})
```
