Repository navigation
Conversation
… types
The input types of aggregation predicates (`<table>_aggregate_bool_exp`,
`<table>_aggregate_bool_exp_<function>` and the arguments object types) were
built without the source's `type_names` customization, while the types they
reference were prefixed. Two sources with the same table name and distinct
prefixes therefore clashed on the bare type name as soon as both exposed
aggregation predicates for it ("Found conflicting definitions for GraphQL
type").
Renaming existing types is a breaking change for clients that reference them
in variable definitions, so the customization is applied only with
HASURA_FF_NAMING_CONVENTION_SEP_2023 enabled, alongside the other opt-in naming
fixes.
Fixes hasura#10875
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hasura-bot
added a commit
that referenced
this pull request
Oct 22, 2026
… types (fix #10875) GITHUB_PR_NUMBER: 10890 GITHUB_PR_URL: #10890 PR-URL: hasura/graphql-engine-mono#11815 GitOrigin-RevId: 8c91de0c9caaef059ec586cddcd9a468f1e34cd8
hasura-bot
added a commit
that referenced
this pull request
Oct 23, 2026
… types (fix #10875) GITHUB_PR_NUMBER: 10890 GITHUB_PR_URL: #10890 PR-URL: hasura/graphql-engine-mono#11815 GitOrigin-RevId: 9301c1e3b15e50ebdd5de2320ca4630079c0eb94
hasura-bot
added a commit
that referenced
this pull request
Oct 23, 2026
… types (fix #10875) GITHUB_PR_NUMBER: 10890 GITHUB_PR_URL: #10890 PR-URL: hasura/graphql-engine-mono#11815 GitOrigin-RevId: b27dc097941cf4bb3acbc30c43c4670a374e5c63
Contributor
|
@russelgal thank you for contributing. The fix will be released soon in v2.51.2 |
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.
Description
The input types of aggregation predicates —
<table>_aggregate_bool_exp,<table>_aggregate_bool_exp_<function>and the arguments object types — are built without the source'stype_namescustomization, while every type they reference is prefixed. Two sources with the same table name and distinct prefixes therefore clash on the bare type name as soon as both expose aggregation predicates for it, and the schema fails withFound conflicting definitions for GraphQL type.With
HASURA_FF_NAMING_CONVENTION_SEP_2023enabled, these types now get the source's prefix and suffix like every other type of the source. Without the flag nothing changes.Changelog
Component : server
Type: bugfix
Product: community-edition
Short Changelog
With
HASURA_FF_NAMING_CONVENTION_SEP_2023enabled, the source's type name prefix and suffix are applied to the input types of aggregation predicates, so sources with the same table name no longer clash on<table>_aggregate_bool_exp.Long Changelog
Related Issues
#10875
Solution and Design
BoolExp.hsbuilds the table boolean expression type through the source customization (runMkTypename $ _rscTypeNames customization), whereasBoolExp/AggregationPredicates.hspassed the name straight toP.object, soMkTypenamenever ran there. The fix applies the sameMkTypenameto the threeP.objectnames in that module.Renaming existing types breaks clients that reference them by name (for example, in variable definitions), so following the discussion in #10875 the change sits behind the existing opt-in
HASURA_FF_NAMING_CONVENTION_SEP_2023flag, together with the other backward-incompatible naming fixes. The flag now affectshasura-defaultsources too, but only for this case and only when the source customizes type names; the docs of the flag are updated accordingly.Steps to test and verify
Unit tests in
Hasura.GraphQL.Schema.BoolExp.AggregationPredicatesSpecbuild the parser for a source with thepfx_type prefix and check introspection:pfx_track_aggregate_bool_exp,pfx_track_aggregate_bool_exp_count(whosefilterispfx_track_bool_exp);track_aggregate_bool_exp, as before.cabal run graphql-engine:test:graphql-engine-testspasses: 1326 examples, 0 failures (CI run in the fork, GHC 9.14.1,-O0).Limitations, known bugs & workarounds
server/lib/api-tests) were not, and the two-source clash itself was not reproduced against a running server with this build.HASURA_GRAPHQL_EXPERIMENTAL_FEATURES=hide_aggregation_predicates, or acustom_nameon one of the tables.Server checklist
Catalog upgrade
Does this PR change Hasura Catalog version?
Metadata
Does this PR add a new Metadata feature?
GraphQL
Breaking changes
No Breaking changes
There are breaking changes:
GraphQL API
Schema Generation:
NamedTypeNot breaking by default. With
HASURA_FF_NAMING_CONVENTION_SEP_2023enabled, theNamedTypes of aggregation predicate input types change for sources with type name customization.🤖 Generated with Claude Code