{"record":{"id":"cd7f660d7b78b69e","repo":"hasura/graphql-engine","slug":"the-aggregate-expression-name-defines-a-graphql","errorCode":null,"errorMessage":"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","messagePattern":"the aggregate expression (.+?) defines a graphql section but it will not appear in the GraphQL API unless (.+?) is also configured in the GraphqlConfig","errorType":"validation","errorClass":"AggregateExpressionIssue","httpStatus":null,"severity":"warning","filePath":"v3/crates/metadata-resolve/src/stages/aggregates/types.rs","lineNumber":90,"sourceCode":"\n#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]\npub struct DataConnectorAggregationFunctionInfo {\n    pub data_connector_name: Qualified<DataConnectorName>,\n    pub function_name: DataConnectorAggregationFunctionName,\n    pub operand_scalar_type: DataConnectorScalarType,\n}\n\n#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]\npub struct AggregateExpressionGraphqlConfig {\n    pub count_field_name: ast::Name,\n    pub count_distinct_field_name: ast::Name,\n\n    pub select_output_type_name: ast::TypeName,\n}\n\n#[derive(Debug, thiserror::Error, PartialEq, Eq, Clone)]\npub enum AggregateExpressionIssue {\n    #[error(\n        \"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\"\n    )]\n    ConfigMissingFromGraphQlConfig {\n        name: Qualified<AggregateExpressionName>,\n        config_name: String,\n    },\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum AggregateExpressionError {\n    #[error(\"the following aggregate expression is defined more than once: {name}\")]\n    DuplicateAggregateExpressionDefinition {\n        name: Qualified<AggregateExpressionName>,\n    },\n\n    #[error(\n        \"the name used by {config_name} from the GraphqlConfig conflicts with the aggregatable field name {aggregatable_field_name} in the aggregate expression {name}\"\n    )]","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregates/types.rs#L72-L108","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\naggregate_expressions:\n  my_avg:\n    graphql: {}\n# GraphqlConfig missing query.aggregate\n# after\nquery:\n  aggregate:\n    count:\n      field_name: count\n      filter_name: filter","handlingStrategy":"validation","validationCode":"for expr in &metadata.aggregate_expressions {\n    if expr.graphql.is_some() {\n        assert!(graphql_config_has(&cfg, &required_config_for(expr)),\n            \"aggregate expression {} declares graphql but {} is missing\",\n            expr.name, required_config_name(expr));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair every graphql section on an aggregate expression with the global GraphqlConfig entry it needs.","Audit metadata for dead graphql sections after config refactors."],"tags":["graphql","config","aggregate-expression"],"backgroundTag":"graphql-config-missing","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}