{"record":{"id":"7d0a13f2c9bcb15a","repo":"hasura/graphql-engine","slug":"unknown-type-type-name","errorCode":null,"errorMessage":"Unknown type: {type_name}","messagePattern":"Unknown type: (.+?)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/arguments/error.rs","lineNumber":26,"sourceCode":"#[error(\"argument '{argument_name}' in {source} has an error: {error}\")]\npub struct NamedArgumentError {\n    pub source: ArgumentSource,\n    pub argument_name: ArgumentName,\n    pub error: ArgumentError,\n}\n\nimpl ContextualError for NamedArgumentError {\n    fn create_error_context(&self) -> Option<error_context::Context> {\n        self.error.create_error_context()\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\n#[allow(clippy::large_enum_variant)]\npub enum ArgumentError {\n    #[error(\"{0}\")]\n    BooleanExpressionError(#[from] boolean_expressions::BooleanExpressionError),\n    #[error(\"Unknown type: {type_name}\")]\n    UnknownType {\n        type_name: Qualified<CustomTypeName>,\n    },\n}\n\nimpl ContextualError for ArgumentError {\n    fn create_error_context(&self) -> Option<error_context::Context> {\n        match self {\n            Self::BooleanExpressionError(error) => error.create_error_context(),\n            Self::UnknownType { .. } => None,\n        }\n    }\n}\n","sourceCodeStart":8,"sourceCodeEnd":40,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/arguments/error.rs#L8-L40","documentation":"Thrown by the metadata-resolve arguments stage when a model or command argument references a type name that is not defined anywhere in the subgraph metadata. During argument resolution every argument's Qualified<CustomTypeName> is looked up in the resolved types collection; a miss yields ArgumentError::UnknownType. It almost always indicates a typo or a missing/failed-to-build OpenDD type definition.","triggerScenarios":"Defining a model/command argument in OpenDD YAML whose type points at a Qualified type name that has no corresponding object or scalar type in the same metadata namespace; renaming a type without updating argument declarations; or a plugin/kind extension type whose definition file was not included in the build.","commonSituations":"Typos in fully-qualified type names (wrong subtype or name), deleting a type still referenced by a command argument, splitting metadata into multiple files and forgetting to include one, or version upgrades that moved types between subtypes.","solutions":["Check the exact type name in the error and fix typos in the argument's type reference (subtype + name)","Verify the referenced type is actually declared in the same OpenDD namespace and its file is included in the metadata build","If the type was renamed, update all argument declarations that still use the old name","Run `ddn build` (or the metadata build step) again to confirm resolution succeeds"],"exampleFix":"# before\narguments:\n  - name: since\n    argumentType: my_sub.My_Typoed_Type\n# after\narguments:\n  - name: since\n    argumentType: my_sub.MyType","handlingStrategy":"validation","validationCode":"// Before building, assert every argument type is declared\nfn check_argument_types(declared: &HashSet<String>, args: &[ArgumentDef]) -> Result<(), String> {\n    for a in args {\n        let q = format!(\"{}.{}\", a.argument_type.subtype, a.argument_type.name);\n        if !declared.contains(&q) {\n            return Err(format!(\"argument '{}' references undeclared type '{}'\", a.name, q));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"// When invoking metadata resolution programmatically\nmatch resolve_metadata(metadata) {\n    Err(e @ ArgumentError::UnknownType { .. }) => {\n        eprintln!(\"undeclared type referenced by an argument: {e}\");\n        // surface to CI and fail the build\n    }\n    other => other,\n}","preventionTips":["Lint all argument type references against declared types in CI before builds","Treat type renames as codemods: grep for the old qualified name across all metadata","Keep all type definitions for a subgraph in the same metadata build"],"tags":["hasura","ddn","metadata","open-dds","type-resolution","rust"],"backgroundTag":"metadata-type-not-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}