GraphReFlyTS

API Reference

graph()

Construct a graph with graph-local topology, lifecycle, and inspection ownership.

Import

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

Signature

function graph(opts: GraphOptions = {}): Graph

Parameters

ParameterTypeDescription
optsGraphOptionsOptional graph name, dispatcher, versioning policy, environment drivers, and profiling switch.

Returns

A Graph instance whose sugar methods create graph-registered nodes.

Example

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

const g = graph({ name: "counter" });
const count = g.state(0, { name: "count" });
const doubled = g.derived([count], ([value]) => value * 2);

Source

packages/ts/src/graph/graph.ts