hasura/graphql-engine · error · ScalarBooleanExpressionOperatorIssue

the argument type '{argument_type}' for the operator '{opera

Error message

the argument type '{argument_type}' for the operator '{operator_name}' in the boolean expression '{type_name}' should match the scalar type '{scalar_type}'

What it means

The operator's argument type must match the scalar type the boolean expression is defined on, but a different type is declared.

Source

Thrown at v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs:146

pub enum ScalarBooleanExpressionOperatorIssue {
    #[error(
        "The operator '{operator_name}' is mapped to '{mapped_operator_name}' for the data connector '{data_connector_name}' in the boolean expression '{type_name}', but the mapped operator is not found in the data connector."
    )]
    MappedOperatorNotFound {
        type_name: Qualified<CustomTypeName>,
        operator_name: OperatorName,
        mapped_operator_name: ndc_models::ComparisonOperatorName,
        data_connector_name: Qualified<DataConnectorName>,
    },
    #[error(
        "the argument type '{argument_type}' for the operator '{operator_name}' in the boolean expression '{type_name}' should be a list"
    )]
    ArgumentTypeShouldBeList {
        type_name: Qualified<CustomTypeName>,
        operator_name: OperatorName,
        argument_type: QualifiedTypeReference,
    },
    #[error(
        "the argument type '{argument_type}' for the operator '{operator_name}' in the boolean expression '{type_name}' should match the scalar type '{scalar_type}'"
    )]
    ArgumentTypeShouldMatchScalar {
        type_name: Qualified<CustomTypeName>,
        operator_name: OperatorName,
        argument_type: QualifiedTypeReference,
        scalar_type: QualifiedTypeName,
    },
    #[error(
        "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}"
    )]
    ArgumentTypeMismatch {
        type_name: Qualified<CustomTypeName>,
        operator_name: OperatorName,
        issue: type_validation::TypeCompatibilityIssue,
    },
    #[error(
        "the operator '{operator_name}' in the boolean expression '{type_name}' is only applicable on string scalars: {reason}"

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Change the operator's argument type to the same scalar type the boolean expression is defined over
  2. If a different argument type is genuinely needed, verify the operator semantics support it

Example fix

// before
# boolean expression on scalar UUID
argument_type: {scalar: String}
// after
argument_type: {scalar: UUID}
Defensive patterns

Strategy: validation

Validate before calling

if &operator.argument_type.underlying_type() != be_type.scalar_type() {
    return Err("argument type must match the boolean expression scalar type");
}

Prevention

When it happens

Trigger: Declaring an operator on a boolean expression type for scalar T whose argument type references a different scalar type U.

Common situations: Copy-pasting an operator definition between boolean expression types for different scalar types without updating the argument type.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/9be1fa9d313f6acd. Report an issue: GitHub.