{"record":{"id":"8a4ded73e8d0f91a","repo":"hasura/graphql-engine","slug":"error-in-type-type-name","errorCode":null,"errorMessage":"{error:} in type {type_name:}","messagePattern":"(.+?) in type (.+?)","errorType":"validation","errorClass":"TypePredicateError::TypeMappingCollectionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":511,"sourceCode":"        relationship_name: Spanned<RelationshipName>,\n        boolean_expression_type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"The model '{target_model_name:}' corresponding to the  relationship '{relationship_name:}' used in predicate for type '{type_name:}' is not defined\"\n    )]\n    UnknownModelUsedInRelationshipTypePredicate {\n        type_name: Qualified<CustomTypeName>,\n        target_model_name: Qualified<ModelName>,\n        relationship_name: RelationshipName,\n    },\n    #[error(\n        \"target source for model '{target_model_name:}' is required to resolve predicate with relationships for {source_type_name:}\"\n    )]\n    TargetSourceRequiredForRelationshipPredicate {\n        source_type_name: Qualified<CustomTypeName>,\n        target_model_name: Qualified<ModelName>,\n    },\n    #[error(\"{error:} in type {type_name:}\")]\n    TypeMappingCollectionError {\n        type_name: Qualified<CustomTypeName>,\n        error: TypeMappingCollectionError,\n    },\n    #[error(\"expected object type for field {field_name:} but field had type {field_type:}\")]\n    ExpectedObjectType {\n        field_type: QualifiedTypeReference,\n        field_name: Spanned<FieldName>,\n    },\n    #[error(\"object type {type_name:} not found\")]\n    ObjectTypeNotFound {\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\"operator mappings not found for data connector {data_connector_name:}\")]\n    OperatorMappingsNotFound {\n        data_connector_name: Qualified<DataConnectorName>,\n    },\n    #[error(\"no type mapping found for type {type_name:} in data connector {data_connector_name:}\")]","sourceCodeStart":493,"sourceCodeEnd":529,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L493-L529","documentation":"Wrapper error attaching the type name to a TypeMappingCollectionError raised while collecting the type mappings for that type. The inner `error` (a TypeMappingCollectionError) describes the concrete problem — e.g. duplicate or conflicting type mappings — and this variant tells you which type it happened on.","triggerScenarios":"A type's mapping collection (the per-type aggregation of field type mappings into the NDC schema) fails — commonly duplicate type mappings for the same type, or conflicting representations collected while building the type's schema.","commonSituations":"Two fields mapping to the same underlying type with different representations; copy-pasted type mappings creating duplicates; connector schema generation hitting inconsistent mappings after metadata merges.","solutions":["Read the inner `{error}` message — it carries the specific TypeMappingCollectionError (e.g. duplicate mapping details)","Fix the reported mapping conflict on `type_name` (remove the duplicate or reconcile the two representations)","Re-run metadata resolve to confirm the collection step now succeeds","Add CI metadata validation to catch mapping conflicts before deploy"],"exampleFix":"# before: same underlying type mapped twice with different representations\n# TypeMappingCollectionError: duplicate mapping ...\n# after: keep a single consistent representation\nfields:\n  a: {type: string, mapping: {column: a}}\n  b: {type: string, mapping: {column: b}}\n","handlingStrategy":"try-catch","validationCode":"// Pre-flight: detect duplicate/conflicting type mappings before resolution\nlet mut seen = HashSet::new();\nfor m in collect_mappings(&type_mappings) {\n    if !seen.insert(m.type_name.clone()) {\n        return Err(format!(\"duplicate mapping for {}\", m.type_name));\n    }\n}\nOk(())","typeGuard":null,"tryCatchPattern":"if let Err(TypePredicateError::TypeMappingCollectionError { type_name, error }) = result {\n    return Err(format!(\"mapping error on {type_name}: {error}\"));\n}","preventionTips":["Keep one canonical representation per underlying type","Run metadata validation after merging metadata from multiple sources"],"tags":["type-mapping","metadata","ndc","hasura"],"backgroundTag":"type-mapping-conflict","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}