hasura/graphql-engine · error · StringOperatorReason
argument type '{argument_type}' is a list
Error message
argument type '{argument_type}' is a list What it means
Nested reason for OnlyApplicableOnStringScalar: the string operator's argument type is a list, but string operator arguments must be single string values.
Source
Thrown at v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs:185
type_name: Qualified<CustomTypeName>,
operator_name: OperatorName,
reason: StringOperatorReason,
},
}
impl ShouldBeAnError for ScalarBooleanExpressionOperatorIssue {
fn should_be_an_error(&self, flags: &flags::OpenDdFlags) -> bool {
flags.contains(flags::Flag::ValidateScalarBooleanExpressionOperators)
}
}
#[derive(Debug, thiserror::Error)]
pub enum StringOperatorReason {
#[error("scalar type '{scalar_type}' is not a string")]
ScalarTypeNotString { scalar_type: QualifiedTypeName },
#[error("argument type '{argument_type}' is not a string")]
ArgumentTypeNotString { argument_type: QualifiedTypeName },
#[error("argument type '{argument_type}' is a list")]
ArgumentTypeShouldNotBeList {
argument_type: QualifiedTypeReference,
},
}
#[derive(Debug, Eq, PartialEq, Copy, Clone, derive_more::with_trait::Display)]
#[allow(clippy::enum_variant_names)] // It's fine that they all end with "Operator" :/
pub enum FieldNameSource {
#[display("comparable operator")]
ComparisonOperator,
#[display("logical operator")]
LogicalOperator,
#[display("is null operator")]
IsNullOperator,
}
View on GitHub (pinned to 724551b9ae)
Solutions
- Remove the list wrapper from the string operator's argument type
Example fix
// before
argument_type: {list: {scalar: String}}
// after
argument_type: {scalar: String} Defensive patterns
Strategy: validation
Validate before calling
if operator.is_string_only() && argument_type.is_list() {
return Err("string operator argument must not be a list");
} Prevention
- Do not reuse list argument shapes from in-style operators for string operators
When it happens
Trigger: Declaring a string operator (like/ilike) whose argument type is wrapped in a list.
Common situations: Copy-pasting list-style argument types from in-style operators onto string operators.
Related errors
- the operator '{operator_name}' in the boolean expression '{t
- scalar type '{scalar_type}' is not a string
- argument type '{argument_type}' is not a string
- failed to list inconsistent metadata: %w
- the operand type '{operand_type}' does not match the operand
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/fbaaed42f0cee11e.
Report an issue: GitHub.