{"record":{"id":"80a78177cfbc675c","repo":"hasura/graphql-engine","slug":"the-boolean-expression-type-name-has-a-graphql","errorCode":null,"errorMessage":"the boolean expression '{type_name}' has a GraphQL field name conflict between the '{name}' {name_source_1} and the '{name}' {name_source_2}. One of these will need to be renamed.","messagePattern":"the boolean expression '(.+?)' has a GraphQL field name conflict between the '(.+?)' (.+?) and the '(.+?)' (.+?)\\. One of these will need to be renamed\\.","errorType":"validation","errorClass":"BooleanExpressionIssue::GraphqlFieldNameConflict","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/boolean_expressions/types.rs","lineNumber":58,"sourceCode":"        boolean_expression_type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"the comparable field '{name}' is defined more than once in the boolean expression type '{type_name}'\"\n    )]\n    DuplicateComparableFieldFound {\n        type_name: Qualified<CustomTypeName>,\n        name: FieldName,\n    },\n    #[error(\n        \"the comparable relationship '{name}' is defined more than once in the boolean expression type '{type_name}'\"\n    )]\n    DuplicateComparableRelationshipFound {\n        type_name: Qualified<CustomTypeName>,\n        name: RelationshipName,\n    },\n    #[error(\n        \"the boolean expression '{type_name}' has a GraphQL field name conflict between the '{name}' {name_source_1} and the '{name}' {name_source_2}. One of these will need to be renamed.\"\n    )]\n    GraphqlFieldNameConflict {\n        type_name: Qualified<CustomTypeName>,\n        name: String,\n        name_source_1: FieldNameSource,\n        name_source_2: FieldNameSource,\n    },\n    #[error(\n        \"the type of the comparable field '{field_name}' on the boolean expresssion '{boolean_expression_type_name}' is a multidimensional array type: {field_type}. Multidimensional arrays are not supported in boolean expressions\"\n    )]\n    MultidimensionalArrayComparableFieldNotSupported {\n        boolean_expression_type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"the target model '{target_model_name}' of the relationship '{relationship_name}' does not have a boolean expression type defined\"","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/boolean_expressions/types.rs#L40-L76","documentation":"Two members of the boolean expression type (fields and/or relationships) produce the same GraphQL field name after applying naming/renaming rules. GraphQL object fields must be unique, so one must be renamed.","triggerScenarios":"A comparable field and a comparable relationship (or two entries after GraphQL name normalization/renaming) both resolve to the same GraphQL field name on the boolean expression type.","commonSituations":"A field `author` and a relationship also named `author`; renames applied via graphql_config causing a collision; name normalization (camelCase conversion) collapsing two distinct snake_case names into one.","solutions":["Rename one of the conflicting entries (field or relationship) in metadata so their GraphQL names differ","Check for graphql_config renames that create the collision and adjust them","Watch for camelCase normalization collisions between snake_case names differing only in underscores"],"exampleFix":"// before\nfields:\n  author_id: Uuid\nrelationships:\n  - name: authorId   # conflicts after normalization with a field 'author_id' -> 'authorId'\n// after\nrelationships:\n  - name: author","handlingStrategy":"validation","validationCode":"// Simulate GraphQL naming to detect collisions before resolve\nuse std::collections::BTreeSet;\nlet mut names = BTreeSet::new();\nfor f in be_type.comparable_fields.iter().map(|f| graphql_name(&f.name))\n    .chain(be_type.comparable_relationships.iter().map(|r| graphql_name(&r.name))) {\n    if !names.insert(f.clone()) {\n        return Err(format!(\"GraphQL name conflict on {f}\"));\n    }\n}","typeGuard":"fn graphql_name_conflicts(be_type: &BooleanExpressionType) -> Vec<String> {\n    let mut seen: HashMap<String, usize> = HashMap::new();\n    for n in be_type.graphql_member_names() { *seen.entry(n).or_default() += 1; }\n    seen.into_iter().filter(|(_, c)| *c > 1).map(|(n, _)| n).collect()\n}","tryCatchPattern":"if let BooleanExpressionIssue::GraphqlFieldNameConflict { type_name, name, name_source_1, name_source_2 } = &issue {\n    eprintln!(\"rename the '{name}' {name_source_1} or {name_source_2} in {type_name}\");\n}","preventionTips":["Avoid giving a field and relationship the same name","Account for camelCase normalization and graphql_config renames when naming members","Add a naming-collision lint to metadata CI"],"tags":["rust","hasura","metadata","boolean-expressions","graphql","naming-conflict"],"backgroundTag":"graphql-field-name-conflict","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}