This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk/extension / 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<I, R>

The MutationCall from the options.

attempts ​

Attempts

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).