{"record":{"id":"fcb079f8cc30c858","repo":"hasura/graphql-engine","slug":"the-operator-operator-name-in-the-boolean-expr","errorCode":null,"errorMessage":"the operator '{operator_name}' in the boolean expression '{type_name}' is only applicable on string scalars: {reason}","messagePattern":"the operator '(.+?)' in the boolean expression '(.+?)' is only applicable on string scalars: (.+?)","errorType":"validation","errorClass":"ScalarBooleanExpressionOperatorIssue","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs","lineNumber":163,"sourceCode":"    },\n    #[error(\n        \"the argument type '{argument_type}' for the operator '{operator_name}' in the boolean expression '{type_name}' should match the scalar type '{scalar_type}'\"\n    )]\n    ArgumentTypeShouldMatchScalar {\n        type_name: Qualified<CustomTypeName>,\n        operator_name: OperatorName,\n        argument_type: QualifiedTypeReference,\n        scalar_type: QualifiedTypeName,\n    },\n    #[error(\n        \"the argument type for the operator '{operator_name}' in the boolean expression '{type_name}' is not compatible with the mapped operator's argument type defined in the data connector: {issue}\"\n    )]\n    ArgumentTypeMismatch {\n        type_name: Qualified<CustomTypeName>,\n        operator_name: OperatorName,\n        issue: type_validation::TypeCompatibilityIssue,\n    },\n    #[error(\n        \"the operator '{operator_name}' in the boolean expression '{type_name}' is only applicable on string scalars: {reason}\"\n    )]\n    OnlyApplicableOnStringScalar {\n        type_name: Qualified<CustomTypeName>,\n        operator_name: OperatorName,\n        reason: StringOperatorReason,\n    },\n}\n\nimpl ShouldBeAnError for ScalarBooleanExpressionOperatorIssue {\n    fn should_be_an_error(&self, flags: &flags::OpenDdFlags) -> bool {\n        flags.contains(flags::Flag::ValidateScalarBooleanExpressionOperators)\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum StringOperatorReason {\n    #[error(\"scalar type '{scalar_type}' is not a string\")]","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs#L145-L181","documentation":"A string-only operator (like like/ilike) was applied to a boolean expression type whose scalar or argument types are not strings; the reason variant details which check failed.","triggerScenarios":"Defining string operators on non-string scalar types, using non-string argument types for string operators, or wrapping string operator arguments in lists.","commonSituations":"Copying a full operator set (including like/ilike) onto numeric, uuid, or date scalar types.","solutions":["Remove string-only operators from non-string scalar boolean expression types","Fix the argument type so it is a non-list string matching the scalar (per the nested reason)"],"exampleFix":"// before\n# boolean expression on scalar Numeric\noperators:\n  - name: like\n// after\n# boolean expression on scalar Numeric\noperators:\n  - name: less_than","handlingStrategy":"validation","validationCode":"fn is_stringy(t: &QualifiedTypeName) -> bool { matches!(t, QualifiedTypeName::BuiltIn(BuiltInType::String)) }\nif operator.is_string_only() && !(is_stringy(scalar) && is_stringy(&arg)) {\n    return Err(\"string operator on non-string type\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scope like/ilike operators to string boolean expression types only"],"tags":["type-mismatch","string-operator","boolean-expression","metadata"],"backgroundTag":"argument-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}