| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (3 classes)
|
Sorry, something went wrong.
There was a problem hiding this comment.
Well the code is very AI ish
But the tests seem clean so....
Sorry, something went wrong.
|
Hello, this pull request has been inactive for 60 days, so we're marking it as stale. If you would like to continue working on this pull request, please make an update within the next 30 days, or we'll close the pull request. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #3868.
This implements the merged spec change from graphql/graphql-spec#860: subscription root selections must not use @skip or @include. This aligns GraphQL Java with graphql-js graphql/graphql-js#3974.
Why this is different from the reverted implementation
The previous GraphQL Java implementation in #3871 was reverted by #3917 because it tried to coerce variables during validation and then used the execution FieldCollector. That made validation depend on runtime-style variable handling, and it failed when validation did not have the complete execution input variables available.
This implementation avoids that problem by not evaluating @skip or @include for this validation rule. It also does not introduce a separate subscription-only document traversal. Instead, OperationValidator now reuses its existing operation-scoped traversal and fragment retraversal, the same path already used for operation-scoped rules such as variable usage, defer validation, and complexity tracking.
The rule keeps small operation-local state while the existing traversal runs:
There is no ValuesResolver.coerceVariableValues call, no empty runtime variable map passed into execution collection, no execution FieldCollector, and no custom conditional runtime decision involved.
That matches the reason the spec changed: validation must be able to determine subscription root fields without access to runtime variable values. It also catches cases the reverted implementation could miss, such as @skip(if: true) or @include(if: false) on root subscription selections.
Tests
Added Spock coverage for:
Added JMH coverage for:
Local verification:
Local JMH Comparison
Ran on the same machine with JDK 25.0.2:
Results, ms/op lower is better:
Repeated the subscription benchmark with more samples:
Interpretation: I do not see a general validation regression in the large-schema and many-fragment validation benchmarks. The synthetic complex subscription benchmark shows a small, measurable cost of about 0.010 ms/op for the new rule logic, which is the expected cost of tracking subscription root selections syntactically during the existing validation traversal instead of using execution field collection.