Fix GraphQL aggregation features disabled when runtime.graphql config section is absent#3450
Draft
Fix GraphQL aggregation features disabled when runtime.graphql config section is absent#3450
Conversation
…n is absent - Fix RuntimeConfig.EnableAggregation to use consistent OR logic (returns true when Runtime is null or Runtime.GraphQL is null, matching IsGraphQLEnabled pattern) - Fix GraphQLSchemaCreator.OnConfigChanged to update _isAggregationEnabled on hot-reload - Add enable-aggregation to dab.draft.schema.json (runtime.graphql section) - Add unit tests: EnableAggregation defaults to true when graphql/runtime section absent, can be explicitly disabled; QueryBuilder adds groupBy to MSSQL connection type but not PostgreSQL Agent-Logs-Url: https://github.com/Azure/data-api-builder/sessions/b4c70fb5-8795-4c8a-a904-d54344395c93 Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
…BuilderTests Agent-Logs-Url: https://github.com/Azure/data-api-builder/sessions/b4c70fb5-8795-4c8a-a904-d54344395c93 Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing GraphQL aggregation features in DAB 2.0.0-rc schema
Fix GraphQL aggregation features disabled when runtime.graphql config section is absent
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
GraphQL aggregation features (
groupBy,sum,avg,min,max,count) were silently disabled for users whose config lacked an explicitruntime.graphqlsection, even thoughEnableAggregationdefaults totrue.What is this change?
Bug fix:
RuntimeConfig.EnableAggregationlogic inversionThe property used
&&logic, returningfalsewhenRuntimeorRuntime.GraphQLwasnull. This is inconsistent with every analogous property (e.g.IsGraphQLEnabled) which use||logic to treat absence as "use default (enabled)":Additional fixes:
GraphQLSchemaCreator.OnConfigChangednow updates_isAggregationEnabledon hot-reload (was omitted, causing stale state)schemas/dab.draft.schema.json: addedenable-aggregationtoruntime.graphqlproperties — it was missing despiteadditionalProperties: false, meaning any config explicitly setting the flag would fail schema validationHow was this tested?
RuntimeConfigLoaderTests:EnableAggregationdefaults totruewhenruntimeorruntime.graphqlsections are absent; correctly honours explicittrue/falseQueryBuilderTests:groupByfield added to connection type for MSSQL (supported), absent for PostgreSQL (not inAggregationEnabledDatabaseTypes), absent when disabledSample Request(s)
With a config that has no explicit
runtime.graphqlsection, the following now works as expected for MSSQL/DWSQL entities:{ books { groupBy(fields: [price]) { fields { price } aggregations { count sum(field: price) avg(field: price) max(field: price) min(field: price) } } } }