> ## Documentation Index
> Fetch the complete documentation index at: https://wundergraphinc-brendan-add-external-directive.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retry

> Configure retries to increase reliability.

By default, the router retries GraphQL operation of type `Query` on specific network errors and HTTP status codes (502, 503, 504, 429). We don't retry after the body is consumed. The default retry strategy is `Backoff and Jitter`. You can read more about our default retry strategy on the [AWS Architecture Blog](https://aws.amazon.com/de/blogs/architecture/exponential-backoff-and-jitter/).

```yaml
# config.yaml

# See https://cosmo-docs.wundergraph.com/router/configuration#config-file
# for the full list of configuration options.

traffic_shaping:
  all: # Rules are applied to all subgraph requests.
    retry: # Rule is only applied to GraphQL operations of type "query"
      enabled: true
      algorithm: "backoff_jitter"
      max_attempts: 5
      interval: 3s
      max_duration: 10s
```

* `enabled`: Enables the retry mechanism for GraphQL query operations.

* `algorithm`: Select the algorithm for the retry. Currently, only `backoff_jitter` is supported. Additional fields depend on the algorithm selection:

* **backoff\_jitter**

  * `max_attempts`: The maximum number of attempts before the operation is considered a failure.

  * `interval`: The time duration between each retry attempt. Increase with every retry.

  * `max_duration`: The maximum allowable duration between retries (random).

### Debugging

You can see the attempts by enabling [debug](/router/development/debugging#debug-log-level) mode.

<Note>
  Mutations won't be retried because they aren't idempotent.
</Note>
