Skip to content
PACKAGES

explainPath()

Explain the shortest describe-edge path from from to to.

This is the rich companion to Graph.describe({ explain }): it reports found/no-path status and per-hop metadata, but remains a pure helper over the snapshot.

import { explainPath } from "@graphrefly/ts/graph";
function explainPath(
snapshot: DescribeSnapshot,
from: string,
to: string,
options: ExplainPathOptions = {},
): CausalChain
ParameterTypeDescription
snapshotDescribeSnapshotsnapshot value used by the helper.
fromstringfrom value used by the helper.
tostringto value used by the helper.
optionsExplainPathOptionsOptions that configure the helper.

A CausalChain value.

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

packages/ts/src/graph/diagnostics.ts