---
url: >-
  https://game-engine-io.github.io/enginex-frontend-sdk/reference/api/@getenginex/sdk/extension/functions/runMutation.md
---
[Reference](../../../../index.md) / [@getenginex/sdk/extension](../index.md) / runMutation

# runMutation()

> **runMutation**<`I`, `R`>(`call`, `attempts`, `input`): `Promise`<`R`>

Runs the call with the attempt's key and closes the attempt with the result: an ambiguous failure keeps
the key, anything else discards it.

## Type Parameters

### I

`I`

### R

`R`

## Parameters

### call

[`MutationCall`](../interfaces/MutationCall.md)<`I`, `R`>

The [MutationCall](../interfaces/MutationCall.md) from the options.

### attempts

[`Attempts`](../interfaces/Attempts.md)

The caller's attempt (from `createAttempts`).

### input

`I`

The mutation input.

## Returns

`Promise`<`R`>

## Example

```ts
const data = await runMutation(call, attempts, { amount: 5000 })
```

## Throws

Always `EnginexError`: the call's error, or `CONFIGURATION_ERROR` if the key
cannot be generated (an environment without Web Crypto).
