Graphs hooks

Hand-written shim. Generated graph CRUD via ./graphs.gen. The hooks below cover (a) the `data` query — full graph load (instance + nodes + edges) — and (b) graph-node / graph-edge composite hooks that don't fit the standard CRUD kinds. GraphDefinition hooks (CRUD + node/edge definition helpers) live in ./graph-definitions.ts.

Hooks

useDeleteGraph mutation

Soft-delete a graph instance.

TypeScript
useDeleteGraph(options?: MutationOpts<SuccessResponse, string>)

Types: SuccessResponse

useGetGraphData query

Load the full graph — instance metadata plus every node and edge. Custom hook: backed by the bespoke /api/graphs/:id/data endpoint that doesn't fit the standard CRUD kinds.

TypeScript
useGetGraphData(graphId: string, options?: QueryOpts)
TypeScript
const { data } = useGetGraphData("grp_abc123");

useListGraphEdges query

TypeScript
useListGraphEdges(params: { graph_id: string; [k: string]: unknown; }, options?: QueryOpts)

useListGraphNodes query

TypeScript
useListGraphNodes(params: { graph_id: string; [k: string]: unknown; }, options?: QueryOpts)

useListGraphs query

List graph instances.

TypeScript
useListGraphs(params?: Omit<ListGraphsParams, | > & { filter?: GraphFilter; orderBy?: GraphOrderBy[]; } & GraphShorthands, options?: QueryOpts<Page<Graph>>)

Types: ListGraphsParams · GraphFilter · GraphOrderBy · GraphShorthands · Page · Graph

usePurgeGraph composite

Permanently delete a soft-deleted graph instance.

TypeScript
usePurgeGraph(options?: MutationOpts<SuccessResponse, PurgeGraphParams>)

Types: SuccessResponse · PurgeGraphParams

useRemoveGraphNode mutation

TypeScript
useRemoveGraphNode(options?: MutationOpts<unknown, string>)

useRestoreGraph composite

Restore a soft-deleted graph instance.

TypeScript
useRestoreGraph(options?: MutationOpts<Graph, string>)

Types: Graph

useRetrieveGraph query

Get a graph instance by ID.

TypeScript
useRetrieveGraph(id: string, options?: QueryOpts<Graph>)

Types: Graph

useRetrieveGraphEdge query

TypeScript
useRetrieveGraphEdge(id: string, options?: QueryOpts)

useRetrieveGraphNode query

TypeScript
useRetrieveGraphNode(id: string, options?: QueryOpts)