API Reference
cqrsSubmitCommand()
Creates a CQRS submit command.
Import
import { cqrsSubmitCommand } from "@graphrefly/ts/cqrs/work-queue";
Signature
function cqrsSubmitCommand(
command: CqrsCommand<TCommand>,
opts: {
readonly workId?: string;
readonly commandId?: string;
readonly idempotencyKey?: string;
readonly sourceRefs?: readonly string[];
readonly policyRefs?: readonly string[];
readonly actorRefs?: readonly string[];
readonly auditRefs?: readonly string[];
readonly metadata?: Record<string, unknown>;
} = {},
): WorkQueueCommand<CqrsQueuedCommandPayload<TCommand>>
Parameters
| Parameter | Type | Description |
|---|---|---|
command | CqrsCommand<TCommand> | command value used by the helper. |
opts | { readonly workId?: string; readonly commandId?: string; readonly idempotencyKey?: string; readonly sourceRefs?: readonly string[]; readonly policyRefs?: readonly string[]; readonly actorRefs?: readonly string[]; readonly auditRefs?: readonly string[]; readonly metadata?: Record<string, unknown>; } | Options that configure the helper. |
Returns
The CQRS submit command result.
Example
import { cqrsSubmitCommand } from "@graphrefly/ts/cqrs/work-queue";
Source
packages/ts/src/cqrs/work-queue.ts