useGraphNeighbors()
function useGraphNeighbors<T>(EntityType, options): RxDBResource<InstanceType<T>[]>;
Defined in: hooks.ts:318
Find neighbor entities in a graph structure
Type Parameters
| Type Parameter |
|---|
T extends EntityType |
Parameters
| Parameter | Type | Description |
|---|---|---|
EntityType | T | The entity class |
options | UseOptions<EntityStaticType<T, "findNeighborsOptions">> | Graph query options (entityId, direction, level, etc.) |
Returns
RxDBResource<InstanceType<T>[]>
A resource object containing neighbor entities
Example
const { value: friends } = useGraphNeighbors(User, {
entityId: 'user-1',
direction: 'out',
level: 1
});