{"record":{"id":"0f06422b175d1c28","repo":"hasura/graphql-engine","slug":"boolean-expressions-with-aggregate-operands-are-no","errorCode":null,"errorMessage":"boolean expressions with aggregate operands are not supported","messagePattern":"boolean expressions with aggregate operands are not supported","errorType":"validation","errorClass":"AggregateBooleanExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":128,"sourceCode":"    pub type_name: ast::TypeName,\n}\n\n#[derive(Debug, thiserror::Error)]\n#[error(\"error in boolean expression type '{type_name}': {error}\")]\npub struct NamedAggregateBooleanExpressionError {\n    pub type_name: Qualified<CustomTypeName>,\n    pub error: AggregateBooleanExpressionError,\n}\n\nimpl ContextualError for NamedAggregateBooleanExpressionError {\n    fn create_error_context(&self) -> Option<error_context::Context> {\n        None\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum AggregateBooleanExpressionError {\n    #[error(\"boolean expressions with aggregate operands are not supported\")]\n    AggregateBooleanExpressionsNotSupported,\n\n    #[error(\"boolean expressions with aggregate operands do not support isNull comparisons\")]\n    IsNullComparisonsNotSupported,\n\n    #[error(\"{0}\")]\n    GraphqlConfigError(#[from] GraphqlConfigError),\n\n    #[error(\"the operand type '{operand_type}' must be a scalar type\")]\n    OperandTypeIsNotAScalarType {\n        operand_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(\"the operand type '{operand_type}' must be an object type\")]\n    OperandTypeIsNotAnObjectType {\n        operand_type: Qualified<CustomTypeName>,\n    },\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L110-L146","documentation":"AggregateBooleanExpressionError::AggregateBooleanExpressionsNotSupported is returned when a boolean expression is defined with aggregate operands in a context where aggregate operands are not supported (the variant exists to explicitly reject such definitions during resolution).","triggerScenarios":"Defining a boolean expression type whose operands involve aggregate expressions in a metadata context that does not allow them (e.g. using an aggregate-capable filter where only scalar/object comparisons are valid).","commonSituations":"Attempting to filter on aggregated values in places where only row-level comparisons apply; version changes that tightened restrictions on aggregate boolean expressions.","solutions":["Remove the aggregate operands from the boolean expression definition","Redesign the operation to compute the aggregate separately and filter on the result, rather than inside the boolean expression","Check the docs for where aggregate boolean expressions are permitted"],"exampleFix":"# before\nboolean_expression:\n  operands:\n    - aggregate: count   # not supported here\n\n# after\nboolean_expression:\n  operands:\n    - field: status","handlingStrategy":"validation","validationCode":"fn uses_aggregate_operands(expr: &BooleanExpressionDef) -> bool {\n    expr.operands.iter().any(|o| o.aggregate.is_some())\n}\n// reject before submission in contexts where aggregates are disallowed","typeGuard":null,"tryCatchPattern":"if let AggregateBooleanExpressionError::AggregateBooleanExpressionsNotSupported = err {\n    eprintln!(\"aggregate operands are not allowed here; use plain field comparisons\");\n}","preventionTips":["Know which filter contexts permit aggregate operands","Keep row-level and aggregate-level filtering separate in designs","Track release notes for changes to aggregate expression support"],"tags":["metadata","boolean-expression","aggregate","unsupported"],"backgroundTag":"unsupported-operation-config","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}