hasura/graphql-engine · error · StringOperatorReason
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.
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
- argument type ' ' is not a string
- scalar type ' ' is not a string
- the operator ' ' in the boolean expression ' ' is only…
- failed to list inconsistent metadata
- the aggregate expression
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/fbaaed42f0cee11e.
Report an issue: GitHub.
Appendix: 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)