{"record":{"id":"c18d72fbf7683d65","repo":"langchain-ai/langgraph","slug":"graph-graph-id-must-be-a-string-or-a-dictionar","errorCode":null,"errorMessage":"Graph '{graph_id}' must be a string or a dictionary with a 'path' key.","messagePattern":"Graph '(.+?)' must be a string or a dictionary with a 'path' key\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/cli/langgraph_cli/config.py","lineNumber":878,"sourceCode":"    Raises:\n        ValueError: If the import string is not in the format `<module>:<attribute>`\n                    or if the referenced local file is not found in `dependencies`.\n        FileNotFoundError: If the local file (module) does not actually exist on disk.\n        IsADirectoryError: If `module_str` points to a directory instead of a file.\n    \"\"\"\n    for graph_id, data in config[\"graphs\"].items():\n        if isinstance(data, dict):\n            # Then we're looking for a 'path' key\n            if \"path\" not in data:\n                raise ValueError(\n                    f\"Graph '{graph_id}' must contain a 'path' key if \"\n                    f\" it is a dictionary.\"\n                )\n            import_str = data[\"path\"]\n        elif isinstance(data, str):\n            import_str = data\n        else:\n            raise ValueError(\n                f\"Graph '{graph_id}' must be a string or a dictionary with a 'path' key.\"\n            )\n\n        module_str, _, attr_str = import_str.partition(\":\")\n        if not module_str or not attr_str:\n            message = (\n                'Import string \"{import_str}\" must be in format \"<module>:<attribute>\".'\n            )\n            raise ValueError(message.format(import_str=import_str))\n\n        # Check for either forward slash or backslash in the module string\n        # to determine if it's a file path.\n        if \"/\" in module_str or \"\\\\\" in module_str:\n            # Resolve the local path properly on the current OS\n            resolved = (config_path.parent / module_str).resolve()\n            if not resolved.exists():\n                raise FileNotFoundError(f\"Could not find local module: {resolved}\")\n            elif not resolved.is_file():","sourceCodeStart":860,"sourceCodeEnd":896,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/cli/langgraph_cli/config.py#L860-L896","documentation":"Error \"Graph '{graph_id}' must be a string or a dictionary with a 'path' key.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/cli/langgraph_cli/config.py:878 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"}