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 be a list

What it means

For operators that take multiple arguments (like _in), the declared argument type must be a list, but the metadata declares a non-list type.

Source

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

            ScalarBooleanExpressionTypeIssue::OperatorIssue(issue) => {
                issue.should_be_an_error(flags)
            }
        }
    }
}

#[derive(Debug, thiserror::Error)]
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}"

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Wrap the argument type in a list, e.g. use the array/list form of the type reference
  2. Model the argument on built-in boolean expression types which use lists for in-style operators

Example fix

// before
argument_type: {scalar: my_scalar}
// after
argument_type: {list: {scalar: my_scalar}}
Defensive patterns

Strategy: validation

Validate before calling

if operator.expects_list_argument && !argument_type.is_list() {
    return Err("argument type should be a list");
}

Prevention

When it happens

Trigger: Defining an operator such as 'in' whose argument type in the boolean expression type is a scalar (or otherwise non-list) QualifiedTypeReference.

Common situations: Hand-writing boolean expression operators and forgetting the array wrapper for list-based operators.

Related errors


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