> ## Documentation Index
> Fetch the complete documentation index at: https://uom-demo.vercel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use graph state context

## Interfaces

### GraphStateContextType

Defined in: [hooks/use-graph-state-context.ts:9](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L9)

Context value structure for the LangGraph State Graph.
Holds active node execution state, errors, and the current state snapshot of the translation pipeline.

#### Properties

##### activeNode

```ts theme={null}
activeNode: 
  | "extract_input"
  | "schema_inspection"
  | "generate_translation_node"
  | "prep_schema_validation"
  | "validate_schema_node"
  | "prep_query_validation"
  | "validate_query_node"
  | "prep_query_equivalence"
  | "check_query_equivalence_node"
  | "evaluation_node"
  | "human_intervention_node"
  | null;
```

Defined in: [hooks/use-graph-state-context.ts:21](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L21)

The currently active LangGraph node matching keys of NODE\_NAME\_MAP.

##### error

```ts theme={null}
error: 
  | {
  error?: any;
  message: string;
}
  | null;
```

Defined in: [hooks/use-graph-state-context.ts:13](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L13)

Tracks general runtime errors displayed in a global banner.

##### graphState

```ts theme={null}
graphState: Partial<BackendState>;
```

Defined in: [hooks/use-graph-state-context.ts:11](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L11)

Represents the structured state values of the orchestrator state graph.

##### runError

```ts theme={null}
runError: 
  | {
  error?: any;
  message: string;
}
  | null;
```

Defined in: [hooks/use-graph-state-context.ts:17](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L17)

Tracks execution errors that happen specifically during run processes (e.g. streaming issues).

##### setError

```ts theme={null}
setError: (error: 
  | {
  error?: any;
  message: string;
}
  | null) => void;
```

Defined in: [hooks/use-graph-state-context.ts:15](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L15)

Sets or clears a general runtime error.

###### Parameters

###### error

\| \{
`error?`: `any`;
`message`: `string`;
}
\| `null`

###### Returns

`void`

##### setRunError

```ts theme={null}
setRunError: (error: 
  | {
  error?: any;
  message: string;
}
  | null) => void;
```

Defined in: [hooks/use-graph-state-context.ts:19](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L19)

Sets or clears a run-specific error.

###### Parameters

###### error

\| \{
`error?`: `any`;
`message`: `string`;
}
\| `null`

###### Returns

`void`

## Variables

### GraphStateContext

```ts theme={null}
const GraphStateContext: Context<GraphStateContextType>;
```

Defined in: [hooks/use-graph-state-context.ts:27](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L27)

React Context object that shares the LangGraph state and execution status across the application.

## Functions

### useGraphStateContext()

```ts theme={null}
function useGraphStateContext(): GraphStateContextType;
```

Defined in: [hooks/use-graph-state-context.ts:43](https://github.com/corovcam/Universal-Object-Mapping/blob/main/frontend/uom-translator-ui/hooks/use-graph-state-context.ts#L43)

Custom React hook that accesses the GraphStateContext.
Must be used within an `AssistantRuntimeProviderWrapper` component.

#### Returns

[`GraphStateContextType`](#graphstatecontexttype)

The current LangGraph state context value.

#### Throws

If called outside of a provider context.
