hasura/graphql-engine · warning · AggregateBooleanExpressionIssue
a {count_type} aggregation is defined but it will not appear
Error message
a {count_type} aggregation is defined but it will not appear in the GraphQL API unless count aggregate field names are also configured in the GraphqlConfig in query.aggregate What it means
A count-type aggregation (count or count distinct, per CountAggregateType) is defined on a boolean expression type, but the GraphqlConfig does not configure count aggregate field names in query.aggregate, so the count aggregation will not appear in the GraphQL API.
Source
Thrown at v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs:415
#[display("count distinct aggregation function")]
CountDistinctAggregationFunction,
}
#[derive(Debug, thiserror::Error)]
#[error("issue in boolean expression type '{type_name}': {issue}")]
pub struct NamedAggregateBooleanExpressionIssue {
pub type_name: Qualified<CustomTypeName>,
pub issue: AggregateBooleanExpressionIssue,
}
#[derive(Debug, thiserror::Error)]
pub enum AggregateBooleanExpressionIssue {
#[error(
"a graphql section is defined but it will not appear in the GraphQL API unless logical operator field names are also configured in the GraphqlConfig in query.filterInputConfig"
)]
MissingLogicalOperatorNamesInGraphqlConfig,
#[error(
"a {count_type} aggregation is defined but it will not appear in the GraphQL API unless count aggregate field names are also configured in the GraphqlConfig in query.aggregate"
)]
MissingCountAggregationNamesInGraphqlConfig { count_type: CountAggregateType },
}
View on GitHub (pinned to 724551b9ae)
Solutions
- Add count aggregate field names to query.aggregate in the GraphqlConfig (e.g. count: count, count_distinct: count_distinct or your preferred names).
- Or drop the count aggregation from the boolean expression type if it is not needed in the API.
Example fix
# before
# aggregation defined: count
# query.aggregate not configured
# after
query:
aggregate:
count:
field_name: count
filter_name: filter Defensive patterns
Strategy: validation
Validate before calling
fn count_aggregations_visible(be: &BooleanExpressionType, cfg: &GraphqlConfig) -> bool {
let has_count = be.aggregations.iter().any(|a| matches!(a.function, Count | CountDistinct));
!has_count || cfg.query.aggregate.and_then(|a| a.count).is_some()
} Prevention
- Configure query.aggregate count field names once in a base config.
- If adding count aggregations, verify the GraphqlConfig exposes them in the same change.
When it happens
Trigger: Boolean expression operand aggregations including a count/count-distinct aggregation while query.aggregate in the GraphqlConfig lacks count_aggregate field name configuration.
Common situations: Adding count aggregations to filter expressions without configuring their GraphQL field names; metadata versions where aggregate naming moved into the global GraphqlConfig.
Related errors
- a graphql section is defined but it will not appear in the G
- a graphql section is defined in boolean expression type '{ty
- a graphql section is defined in boolean expression type '{ty
- The aggregation function {aggregation_function} operating ov
- A field ({field_name}) with an AggregatableField annotation
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/c8dbc96531d8d2cf.
Report an issue: GitHub.