{"record":{"id":"76dc163fa8f4aefa","repo":"hasura/graphql-engine","slug":"expected-to-find-a-custom-named-type-in-qualified","errorCode":null,"errorMessage":"expected to find a custom named type in {qualified_type_reference:} but none found","messagePattern":"expected to find a custom named type in (.+?) but none found","errorType":"validation","errorClass":"TypeError::NoNamedTypeFound","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":711,"sourceCode":"            TypePredicateError::ExpectedObjectType { field_type, field_name } => {\n                Some(Context::from_step(\n                    Step {\n                        message: format!(\"Expected field '{field_name}' to have an object type but instead found '{field_type}'\"),\n                        path: field_name.path.clone(),\n                        subgraph: field_type.get_subgraph().cloned(),\n                    }\n                ))\n            }\n\n            TypePredicateError::ScalarBooleanExpressionTypeError(error) => error.create_error_context(),\n            _ => None\n        }\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum TypeError {\n    #[error(\"expected to find a custom named type in {qualified_type_reference:} but none found\")]\n    NoNamedTypeFound {\n        qualified_type_reference: QualifiedTypeReference,\n    },\n    #[error(\"type mismatch: {error:}\")]\n    TypeCheckError { error: TypecheckError },\n}\n\nimpl From<AggregateExpressionError> for Error {\n    fn from(val: AggregateExpressionError) -> Self {\n        Error::AggregateExpressionError(val)\n    }\n}\n\nimpl From<TypecheckError> for Error {\n    fn from(type_error: TypecheckError) -> Self {\n        Error::TypeError {\n            type_error: TypeError::TypeCheckError { error: type_error },\n        }","sourceCodeStart":693,"sourceCodeEnd":729,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L693-L729","documentation":"Thrown by the metadata-resolve crate when resolving a value expression for an argument: the expression's type was expected to resolve to a custom named type (QualifiedTypeReference) but no such named type was found in the resolved metadata. This indicates the metadata refers to a type name that was never defined or not visible in the current subgraph.","triggerScenarios":"Resolving an argument's value expression (resolve_value_expression_for_argument in metadata-resolve/src/helpers/argument.rs) where the declared type reference points to a Qualified<CustomTypeName> that does not exist among the resolved types (e.g. a command/argument typed with an object type defined in a different subgraph or misspelled in the dds file).","commonSituations":"Referencing an object type in a command argument or type predicate that lives in another subgraph without an @foobar import; renaming a type in data.hml without updating references; typos in qualified type names.","solutions":["Verify the type name exists in the same subgraph's types.hml and is spelled identically","If the type lives in another subgraph, add the appropriate import (e.g. @foobar(...) / object type import) so it resolves locally","Re-run metadata resolve after fixing; check ndc-spec types vs custom object types are not mixed up"],"exampleFix":"// before\ncommand MyCommand {\n  argument: someTypeNotDefinedLocally\n}\n// after\n// define/import the type first\nobject type SomeType { ... }\ncommand MyCommand {\n  argument: SomeType\n}","handlingStrategy":"validation","validationCode":"// Before resolving, check the type exists in resolved metadata\nlet exists = resolved_metadata\n    .types\n    .contains_key(&qualified_type_reference.custom_type_name);\nif !exists { /* fail fast with a clear message */ }","typeGuard":null,"tryCatchPattern":"match resolve_value_expression_for_argument(...) {\n    Err(e) if matches!(e.type_error, TypeError::NoNamedTypeFound { .. }) => {\n        // surface which QualifiedTypeReference is missing and fail the build\n    }\n    r => r,\n}","preventionTips":["Define/import all referenced types in the same subgraph before building","Run metadata resolve in CI to catch dangling type references early"],"tags":["metadata","type-resolution","hasura","dds"],"backgroundTag":"undefined-type-reference","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}