GraphReFlyTS

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

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.

Returns

The CQRS submit command result.

Example

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

Source

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