{"record":{"id":"ec50a6c8f8ef1f97","repo":"hasura/graphql-engine","slug":"types-with-conflicting-name-name-found-in-confl","errorCode":null,"errorMessage":"Types with conflicting name {name} found in {conflicting_sources}","messagePattern":"Types with conflicting name (.+?) found in (.+?)","errorType":"validation","errorClass":"ConflictingNameAcrossTypes","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/warning.rs","lineNumber":112,"sourceCode":"    /// Indicates the type is a scalar type\n    #[display(\"ScalarType\")]\n    Scalar,\n    /// Indicates the type is an object type\n    #[display(\"ObjectType\")]\n    Object,\n    /// Indicates the type is a boolean expression type\n    #[display(\"BooleanExpressionType\")]\n    BooleanExpression,\n}\n\n/// Represents a collection of conflicting type sources\n#[derive(Debug, Display)]\n#[display(\"{}\", _0.into_iter().map(std::string::ToString::to_string).collect::<Vec<_>>().join(\", \"))]\npub struct ConflictingSources(pub nonempty::NonEmpty<TypeSource>);\n\n/// Represents an error when a type name conflicts across different type sources\n#[derive(Debug, thiserror::Error)]\n#[error(\"Types with conflicting name {name} found in {conflicting_sources}\")]\npub struct ConflictingNameAcrossTypes {\n    /// The name of the conflicting type\n    pub name: Qualified<CustomTypeName>,\n    /// The sources where the conflicting type was found\n    pub conflicting_sources: ConflictingSources,\n}\n","sourceCodeStart":94,"sourceCodeEnd":119,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/warning.rs#L94-L119","documentation":"A metadata-resolve warning/error: the same type name was defined in more than one type source (e.g. both an ndc entity mapping and a local object type, or two different sources), so the resolver cannot unambiguously pick one. It lists the name and every conflicting source.","triggerScenarios":"Resolving metadata where a Qualified<CustomTypeName> is produced by multiple TypeSources simultaneously — for example a local object type in types.hml plus a type generated from an NDC entity/mapping or a relationship target with the same name.","commonSituations":"Defining an object type locally while the connector's entity mapping already exposes the same name; enabling a feature that auto-generates types that collide with hand-written ones; duplicating type definitions across files.","solutions":["Rename one of the conflicting types so each name maps to a single source","Check the conflicting_sources list to see exactly which sources collide, then remove the duplicate definition","If the collision is intended (override), use the mechanism your version provides for overriding rather than duplicating"],"exampleFix":"// before\n// types.hml defines `object type User` while the entity mapping also exposes `User`\n// after\nobject type AppUser { ... } // renamed locally to avoid the collision","handlingStrategy":"validation","validationCode":"// Detect duplicate names across sources before resolving\nuse std::collections::HashSet;\nlet mut seen = HashSet::new();\nfor src in all_type_sources {\n    for name in src.type_names() {\n        if !seen.insert(name.clone()) {\n            return Err(format!(\"duplicate type name: {name}\"));\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Adopt a naming convention per source to avoid collisions","Lint for locally defined types that shadow connector-mapped entities"],"tags":["metadata","type-conflict","duplicate","hasura"],"backgroundTag":"duplicate-type-definition","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}