Repository navigation
Conversation
Variable usages inside a fragment always got an undefined default value, so VariablesInAllowedPositionRule rejected a nullable variable passed through a fragment to a non-null argument with a default, e.g. `$intVar: Int` used as `nonNullFieldWithDefault(arg: $intVar)` inside a fragment. GraphQL-core 3.2 accepted such queries. Use the argument default for every variable usage, as graphql-js does since graphql/graphql-js#4865. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cito
approved these changes
Oct 27, 2026
Cito
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR, and for the clear description and the tests!
For context: GraphQL-core tracks the tagged graphql-js releases. The current version is based on graphql-js 17.0.2, as you can see in version_js. The upstream fix (graphql/graphql-js#4865) landed after that tag and hasn't been part of a graphql-js release yet. Porting it was already scheduled as the next step of our upcoming update, which will also bring in the other untagged upstream changes since 17.0.2.
That said, the bug is a real regression in 3.3 compared to 3.2, so I'm glad to take your PR as the port of that commit.
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.
Variable usages inside a fragment always got an undefined default value, so VariablesInAllowedPositionRule rejected a nullable variable passed through a fragment to a non-null argument with a default, e.g.
$intVar: Intused asnonNullFieldWithDefault(arg: $intVar)inside a fragment. GraphQL-core 3.2 accepted such queries.Use the argument default for every variable usage, as graphql-js does since graphql/graphql-js#4865.