{"record":{"id":"bb95a3de8055a6dd","repo":"langchain-ai/langgraph","slug":"accessing-graphoutput-via-result-key-is-depreca","errorCode":null,"errorMessage":"Accessing GraphOutput via `result[key]` is deprecated. Use `result.value` to access the output value directly, or `result.interrupts` for interrupts.","messagePattern":"Accessing GraphOutput via `result\\[key\\]` is deprecated\\. Use `result\\.value` to access the output value directly, or `result\\.interrupts` for interrupts\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/types.py","lineNumber":384,"sourceCode":"```\n\"\"\"\n\n\n@dataclass(frozen=True)\nclass GraphOutput(Generic[OutputT]):\n    \"\"\"Typed container returned by `invoke()` / `ainvoke()` with `version=\"v2\"`.\n\n    Attributes:\n        value: The final output of the graph (dict, Pydantic model, dataclass, etc.).\n        interrupts: Any interrupts that occurred during execution.\n    \"\"\"\n\n    value: OutputT\n    interrupts: tuple[Interrupt, ...] = ()\n\n    def __getitem__(self, key: str) -> Any:\n        \"\"\"Backward compat: `result['__interrupt__']` and dict-key access.\"\"\"\n        warn(\n            \"Accessing GraphOutput via `result[key]` is deprecated. \"\n            \"Use `result.value` to access the output value directly, \"\n            \"or `result.interrupts` for interrupts.\",\n            LangGraphDeprecatedSinceV11,\n            stacklevel=2,\n        )\n        if key == _INTERRUPT_KEY:\n            return self.interrupts\n        if isinstance(self.value, dict):\n            return self.value[key]\n        try:\n            return getattr(self.value, key)\n        except AttributeError:\n            raise KeyError(key)\n\n    def __contains__(self, key: object) -> bool:\n        warn(\n            \"Accessing GraphOutput via `key in result` is deprecated. \"","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/types.py#L366-L402","documentation":"Error \"Accessing GraphOutput via `result[key]` is deprecated. Use `result.value` to access the output value directly, or `result.interrupts` for interrupts.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/types.py:384 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}