GraphReFlyTS

API Reference

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

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

Signature

function explainPath(
	snapshot: DescribeSnapshot,
	from: string,
	to: string,
	options: ExplainPathOptions = {},
): CausalChain

Parameters

ParameterTypeDescription
snapshotDescribeSnapshotsnapshot value used by the helper.
fromstringfrom value used by the helper.
tostringto value used by the helper.
optionsExplainPathOptionsOptions that configure the helper.

Returns

A CausalChain value.

Example

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

Source

packages/ts/src/graph/diagnostics.ts