MutationAttempt
interfaz Desde 1.2.0
Un intento de una mutación que terminó, tal como lo reciben onSuccess y onError.
ts
import type { MutationAttempt } from "@meekojs/meeko/framework";Código fuente src/app/runtime/mutations.ts:62
Declaración #
ts
interface MutationAttempt<Input> {
readonly input: Input
readonly idempotencyKey: string | null
readonly trigger: 'mutate' | 'retry' | 'resume'
}Parámetros de tipo #
-
Input Entrada de la mutación.
Ejemplo #
ts
import type { MutationAttempt } from "@meekojs/meeko/framework";
function origin(attempt: MutationAttempt<{ total: number }>): string {
return attempt.trigger === "resume" ? "reintento automático" : "envío del usuario";
}Propiedades #
idempotencyKey
#
readonly idempotencyKey: string | nullUUID de la cabecera Idempotency-Key, o null sin retrySafe.
trigger
#
readonly trigger: 'mutate' | 'retry' | 'resume'Qué envió el intento: "mutate", "retry" (una llamada a retry()) o "resume" (el
reintento automático de retrySafe al montarse un componente o al volver la conexión).