GraphReFlyTS

API Reference

cqrs()

Create a graph-visible CQRS bundle. Command dispatch is only DATA on the returned command node; all derived facts flow through declared graph deps.

Import

import { cqrs } from "@graphrefly/ts/cqrs";

Signature

function cqrs(
	graph: Graph,
	opts: CqrsOptions<TCommand, TEvent> = {},
): CqrsBundle<TCommand, TEvent>

Parameters

ParameterTypeDescription
graphGraphGraph that owns the created nodes or projector.
optsCqrsOptions<TCommand, TEvent>Options that configure the helper.

Returns

A CqrsBundle<TCommand, TEvent> value.

Example

import { cqrs } from "@graphrefly/ts/cqrs";

Source

packages/ts/src/cqrs/index.ts