hasura/graphql-engine · warning · AggregateExpressionIssue
the aggregate expression {name} defines a graphql section bu
Error message
the aggregate expression {name} defines a graphql section but it will not appear in the GraphQL API unless {config_name} is also configured in the GraphqlConfig What it means
An aggregate expression declares a graphql section, but a required piece of the GraphqlConfig ({config_name}) is not configured, so the aggregate expression will not be exposed in the GraphQL API. This warns that the per-expression graphql section is ineffective without the global config entry.
Source
Thrown at v3/crates/metadata-resolve/src/stages/aggregates/types.rs:90
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
pub struct DataConnectorAggregationFunctionInfo {
pub data_connector_name: Qualified<DataConnectorName>,
pub function_name: DataConnectorAggregationFunctionName,
pub operand_scalar_type: DataConnectorScalarType,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
pub struct AggregateExpressionGraphqlConfig {
pub count_field_name: ast::Name,
pub count_distinct_field_name: ast::Name,
pub select_output_type_name: ast::TypeName,
}
#[derive(Debug, thiserror::Error, PartialEq, Eq, Clone)]
pub enum AggregateExpressionIssue {
#[error(
"the aggregate expression {name} defines a graphql section but it will not appear in the GraphQL API unless {config_name} is also configured in the GraphqlConfig"
)]
ConfigMissingFromGraphQlConfig {
name: Qualified<AggregateExpressionName>,
config_name: String,
},
}
#[derive(Debug, thiserror::Error)]
pub enum AggregateExpressionError {
#[error("the following aggregate expression is defined more than once: {name}")]
DuplicateAggregateExpressionDefinition {
name: Qualified<AggregateExpressionName>,
},
#[error(
"the name used by {config_name} from the GraphqlConfig conflicts with the aggregatable field name {aggregatable_field_name} in the aggregate expression {name}"
)]View on GitHub (pinned to 724551b9ae)
Solutions
- Add the missing {config_name} section to your GraphqlConfig (e.g. query.aggregate with the relevant field/filter names).
- Or remove the graphql section from the aggregate expression if GraphQL exposure is not intended.
Example fix
# before
aggregate_expressions:
my_avg:
graphql: {}
# GraphqlConfig missing query.aggregate
# after
query:
aggregate:
count:
field_name: count
filter_name: filter Defensive patterns
Strategy: validation
Validate before calling
for expr in &metadata.aggregate_expressions {
if expr.graphql.is_some() {
assert!(graphql_config_has(&cfg, &required_config_for(expr)),
"aggregate expression {} declares graphql but {} is missing",
expr.name, required_config_name(expr));
}
} Prevention
- Pair every graphql section on an aggregate expression with the global GraphqlConfig entry it needs.
- Audit metadata for dead graphql sections after config refactors.
When it happens
Trigger: An aggregate expression with a graphql: {} block while the GraphqlConfig is missing the related config, e.g. query.aggregate (or the specific naming config named by {config_name}) is not set.
Common situations: Enabling GraphQL exposure on an aggregate expression without adding the matching global GraphqlConfig section; upgrading to a metadata schema where aggregate GraphQL naming is centralized.
Related errors
- a graphql section is defined but it will not appear in the G
- a {count_type} aggregation is defined but it will not appear
- graphql configuration is not defined in supergraph
- the filterInputFieldName for aggregate needs to be defined i
- a graphql section is defined in boolean expression type '{ty
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/cd7f660d7b78b69e.
Report an issue: GitHub.