{"record":{"id":"eae382b7bdad01f8","repo":"hasura/graphql-engine","slug":"scalar-type-type-name-conflicts-with-existing-in","errorCode":null,"errorMessage":"Scalar type {type_name} conflicts with existing inbuilt type","messagePattern":"Scalar type (.+?) conflicts with existing inbuilt type","errorType":"validation","errorClass":"ScalarTypesIssue","httpStatus":null,"severity":"warning","filePath":"v3/crates/metadata-resolve/src/stages/scalar_types/types.rs","lineNumber":24,"sourceCode":"\nuse open_dds::types::CustomTypeName;\n\n#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]\npub struct ScalarTypeRepresentation {\n    pub graphql_type_name: Option<ast::TypeName>,\n    #[serde(default = \"serde_ext::ser_default\")]\n    #[serde(skip_serializing_if = \"serde_ext::is_ser_default\")]\n    pub description: Option<String>,\n}\n\npub struct ScalarTypesOutput {\n    pub scalar_types: BTreeMap<Qualified<CustomTypeName>, ScalarTypeRepresentation>,\n    pub issues: Vec<ScalarTypesIssue>,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum ScalarTypesIssue {\n    #[error(\"Scalar type {type_name} conflicts with existing inbuilt type\")]\n    NameConflictsWithBuiltInType { type_name: CustomTypeName },\n}\n\nimpl ShouldBeAnError for ScalarTypesIssue {\n    fn should_be_an_error(&self, flags: &open_dds::flags::OpenDdFlags) -> bool {\n        match self {\n            ScalarTypesIssue::NameConflictsWithBuiltInType { .. } => flags.contains(\n                open_dds::flags::Flag::DisallowScalarTypeNamesConflictingWithInbuiltTypes,\n            ),\n        }\n    }\n}\n","sourceCodeStart":6,"sourceCodeEnd":37,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/scalar_types/types.rs#L6-L37","documentation":"An issue (not hard error) where a custom scalar type's name collides with a built-in scalar type name.","triggerScenarios":"Defining a ScalarType with a name that matches an inbuilt scalar (e.g. String, Int, Float, Boolean, ID, uuid, date, etc.).","commonSituations":"Custom scalars named after builtin types, which shadows or conflicts with the inbuilt representations.","solutions":["Rename the custom scalar type to something not used by builtin scalars","Check the list of builtin scalar names for the version in use"],"exampleFix":"// before\nkind: ScalarType\nname: String\n// after\nkind: ScalarType\nname: MyString","handlingStrategy":"validation","validationCode":"const BUILTIN: [&str; 6] = [\"String\", \"Int\", \"Float\", \"Boolean\", \"ID\", \"uuid\"];\nif BUILTIN.contains(&scalar_type.name.as_str()) {\n    return Err(\"custom scalar shadows builtin type\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefix custom scalar names (e.g. MyString) to avoid builtin collisions"],"tags":["scalar-type","naming-conflict","builtin","metadata"],"backgroundTag":"naming-conflict-with-builtin","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}