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.
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.
useGetGraphData(graphId: string, options?: QueryOpts)const { data } = useGetGraphData("grp_abc123");useListGraphEdges query
useListGraphEdges(params: { graph_id: string; [k: string]: unknown; }, options?: QueryOpts)useListGraphNodes query
useListGraphNodes(params: { graph_id: string; [k: string]: unknown; }, options?: QueryOpts)useListGraphs query
List graph instances.
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.
usePurgeGraph(options?: MutationOpts<SuccessResponse, PurgeGraphParams>)Types: SuccessResponse · PurgeGraphParams
useRemoveGraphNode mutation
useRemoveGraphNode(options?: MutationOpts<unknown, string>)useRestoreGraph composite
Restore a soft-deleted graph instance.
useRestoreGraph(options?: MutationOpts<Graph, string>)Types: Graph
useRetrieveGraph query
Get a graph instance by ID.
useRetrieveGraph(id: string, options?: QueryOpts<Graph>)Types: Graph
useRetrieveGraphEdge query
useRetrieveGraphEdge(id: string, options?: QueryOpts)useRetrieveGraphNode query
useRetrieveGraphNode(id: string, options?: QueryOpts)