{"record":{"id":"c8dbc96531d8d2cf","repo":"hasura/graphql-engine","slug":"a-count-type-aggregation-is-defined-but-it-will","errorCode":null,"errorMessage":"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","messagePattern":"a (.+?) 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","errorType":"validation","errorClass":"AggregateBooleanExpressionIssue","httpStatus":null,"severity":"warning","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":415,"sourceCode":"    #[display(\"count distinct aggregation function\")]\n    CountDistinctAggregationFunction,\n}\n\n#[derive(Debug, thiserror::Error)]\n#[error(\"issue in boolean expression type '{type_name}': {issue}\")]\npub struct NamedAggregateBooleanExpressionIssue {\n    pub type_name: Qualified<CustomTypeName>,\n    pub issue: AggregateBooleanExpressionIssue,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum AggregateBooleanExpressionIssue {\n    #[error(\n        \"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\"\n    )]\n    MissingLogicalOperatorNamesInGraphqlConfig,\n\n    #[error(\n        \"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\"\n    )]\n    MissingCountAggregationNamesInGraphqlConfig { count_type: CountAggregateType },\n}\n","sourceCodeStart":397,"sourceCodeEnd":420,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L397-L420","documentation":"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.","triggerScenarios":"Boolean expression operand aggregations including a count/count-distinct aggregation while query.aggregate in the GraphqlConfig lacks count_aggregate field name configuration.","commonSituations":"Adding count aggregations to filter expressions without configuring their GraphQL field names; metadata versions where aggregate naming moved into the global GraphqlConfig.","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."],"exampleFix":"# before\n# aggregation defined: count\n# query.aggregate not configured\n# after\nquery:\n  aggregate:\n    count:\n      field_name: count\n      filter_name: filter","handlingStrategy":"validation","validationCode":"fn count_aggregations_visible(be: &BooleanExpressionType, cfg: &GraphqlConfig) -> bool {\n    let has_count = be.aggregations.iter().any(|a| matches!(a.function, Count | CountDistinct));\n    !has_count || cfg.query.aggregate.and_then(|a| a.count).is_some()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure query.aggregate count field names once in a base config.","If adding count aggregations, verify the GraphqlConfig exposes them in the same change."],"tags":["graphql","config","aggregation","count","boolean-expression"],"backgroundTag":"graphql-config-missing","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}