{"record":{"id":"2b9570d77a2d8362","repo":"hasura/graphql-engine","slug":"scalar-type-scalar-type-is-not-a-string","errorCode":null,"errorMessage":"scalar type '{scalar_type}' is not a string","messagePattern":"scalar type '(.+?)' is not a string","errorType":"validation","errorClass":"StringOperatorReason","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs","lineNumber":181,"sourceCode":"    #[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\")]\n    ScalarTypeNotString { scalar_type: QualifiedTypeName },\n    #[error(\"argument type '{argument_type}' is not a string\")]\n    ArgumentTypeNotString { argument_type: QualifiedTypeName },\n    #[error(\"argument type '{argument_type}' is a list\")]\n    ArgumentTypeShouldNotBeList {\n        argument_type: QualifiedTypeReference,\n    },\n}\n\n#[derive(Debug, Eq, PartialEq, Copy, Clone, derive_more::with_trait::Display)]\n#[allow(clippy::enum_variant_names)] // It's fine that they all end with \"Operator\" :/\npub enum FieldNameSource {\n    #[display(\"comparable operator\")]\n    ComparisonOperator,\n    #[display(\"logical operator\")]\n    LogicalOperator,\n    #[display(\"is null operator\")]\n    IsNullOperator,","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs#L163-L199","documentation":"Nested reason for OnlyApplicableOnStringScalar: the scalar type the boolean expression is defined on is not a string type, so string operators cannot apply.","triggerScenarios":"A string operator is configured on a boolean expression type whose underlying QualifiedTypeName is not a string scalar.","commonSituations":"Applying like/ilike operators to numeric, boolean, uuid, or date scalar types.","solutions":["Remove the string operator from this boolean expression type","Define the string operator on a string-based boolean expression type instead"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn is_string_scalar(t: &QualifiedTypeName) -> bool {\n    matches!(t, QualifiedTypeName::BuiltIn(open_dds::types::BuiltInType::String))\n}","tryCatchPattern":null,"preventionTips":["Only attach string operators to string scalar types"],"tags":["type-mismatch","string-operator","scalar","metadata"],"backgroundTag":"argument-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}