feat: improve apollo gateway compatible field selection validation#1169
Merged
endigma merged 16 commits intoJun 11, 2025
Merged
Conversation
3c9be3f to
0b4397c
Compare
5 tasks
devsergiy
requested changes
Jun 6, 2025
devsergiy
approved these changes
Jun 6, 2025
f8830b2 to
57b5188
Compare
This was referenced Jun 11, 2025
endigma
pushed a commit
that referenced
this pull request
Jun 11, 2025
🤖 I have created a release *beep* *boop* --- ## [2.0.0-rc.188](v2.0.0-rc.187...v2.0.0-rc.188) (2025-06-11) ### Features * improve apollo gateway compatible field selection validation ([#1169](#1169)) ([8c1a063](8c1a063)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
endigma
pushed a commit
that referenced
this pull request
Jul 2, 2025
🤖 I have created a release *beep* *boop* --- ## [1.4.0](execution/v1.3.1...execution/v1.4.0) (2025-07-02) ### Features * improve apollo gateway compatible field selection validation ([#1169](#1169)) ([8c1a063](8c1a063)) ### Bug Fixes * support different kinds of close, correct client unsubscribe behaviour ([#1174](#1174)) ([b6de322](b6de322)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a changelog entry for version 1.4.0, highlighting improved field selection validation and enhanced client unsubscribe handling. * **Chores** * Updated the component version to 1.4.0. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.
Currently, we only have Apollo Gateway compatibility for a few basic types of field selection validation, this PR expands it to include and test:
The Apollo extension and 400 status compatibility should also extend to all operation validation errors now, and as such is governed by a new, less specific flag.
It also changes the format for a few existing errors:
field: %s not defined on type: %sCannot query field "%s" on type "%s".cannot select field: %s on scalar %sField "%s" must not have a selection since type "%s" has no subfields.non scalar field: %s on type: %s must have selectionsField "%s" of type "%s" must have a selection of subfields. Did you mean "%[1]s { ... }"?inline fragment on type: %s mismatches enclosing type: %sFragment cannot be spread here as objects of type "%s" can never be of type "%s".We also now pass ScalarLeafsRule ported tests from
graphql-js, so I've enabled them to prevent regressions