API reference > @kontsedal/olas-mutation-queue > MutationQueueOptions
MutationQueueOptions type
Options for mutationQueuePlugin(...). SPEC §13.3.
storage— the underlying durable store.localStorageAdapter()from@kontsedal/olas-persistis the typical default;indexedDbAdapter()when payloads are large or async write is preferred. -keyPrefix— namespace prefix in storage. Required to keep multiple apps on the same origin from colliding. Recommended shape:'<my-app>/mutations/v1'. -maxAttempts— bound on replay attempts per entry. After exhaustion the entry is dropped from storage andonReplayErrorfires with the final error. Defaults to5. -onReplayError— called when the queue gives up on an entry: a failure aftermaxAttempts, a failureisRetryablerejects, a TTL expiry, or an entry whose mutationidno imported module registered. The handler is the integration point for telemetry / user-facing error toasts on lost mutations. -onWarn— soft conditions: malformed entry in storage, serialization failure (variables JSON cannot encode, such as aBigIntor a cycle). Default:console.warn.
Signature:
typescript
type MutationQueueOptions = {
storage: StorageAdapter;
keyPrefix: string;
maxAttempts?: number;
isRetryable?: (err: unknown, entry: QueueEntry) => boolean;
onReplayError?: (err: unknown, entry: QueueEntry) => void;
onReplayAttempt?: (err: unknown, entry: QueueEntry) => void;
dedupeBy?: (mutationId: string, variables: unknown) => string | undefined;
migrate?: (raw: unknown, fromVersion: number) => QueueEntry | null;
ttlMs?: number;
backoffMs?: number;
maxBackoffMs?: number;
maxEntryBytes?: number;
onReplaySettle?: (entry: QueueEntry, result: unknown, queries: QueryHost) => void;
onWarn?: (message: string, cause?: unknown) => void;
};References: StorageAdapter, QueueEntry, QueryHost