Skip to content
PACKAGES

cqrsSubmitCommand()

Creates a CQRS submit command.

import { cqrsSubmitCommand } from "@graphrefly/ts/cqrs/work-queue";
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>>
ParameterTypeDescription
commandCqrsCommand<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.

The CQRS submit command result.

import { cqrsSubmitCommand } from "@graphrefly/ts/cqrs/work-queue";

packages/ts/src/cqrs/work-queue.ts