{"record":{"id":"dabfd750266d127b","repo":"hasura/graphql-engine","slug":"argument-type-argument-type-is-not-a-string","errorCode":null,"errorMessage":"argument type '{argument_type}' is not a string","messagePattern":"argument 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":183,"sourceCode":"    )]\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,\n}\n","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs#L165-L201","documentation":"Nested reason for OnlyApplicableOnStringScalar: the operator's argument type is not a string type.","triggerScenarios":"A string operator's argument uses a non-string QualifiedTypeName (e.g. numeric or uuid).","commonSituations":"Mismatched argument type when hand-authoring string operators.","solutions":["Change the operator's argument type to the string scalar the boolean expression is defined on"],"exampleFix":"// before\nargument_type: {scalar: Numeric}\n// after\nargument_type: {scalar: String}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn argument_is_string(t: &QualifiedTypeName) -> bool {\n    matches!(t, QualifiedTypeName::BuiltIn(open_dds::types::BuiltInType::String))\n}","tryCatchPattern":null,"preventionTips":["Keep string operator arguments typed as the same string scalar"],"tags":["type-mismatch","string-operator","argument","metadata"],"backgroundTag":"argument-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}