Skip to main content

Function: useNodeAncestors()

useNodeAncestors(nodeUri, subkind, options): UseQueryResult<{ ancestors: AncestorPathItem[]; }, Error>

Defined in: web/lib/hooks/use-edges.ts:494

Fetches ancestor path from a node to root(s).

Parameters

nodeUri

string

Node URI

subkind

string = 'field'

Subkind for the hierarchy (e.g., 'field')

options

UseEdgeOptions = {}

Hook options

Returns

UseQueryResult<{ ancestors: AncestorPathItem[]; }, Error>

Query result with ancestor path

Remarks

Fetches the full hierarchy and finds the path to the target node. This is efficient when the hierarchy is already cached.