Repository navigation
Conversation
Contributor
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (1 class)
|
This branch has not been deployed
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.
Argument coercion currently runs only when something reads a field's arguments. A data fetcher that ignores them can therefore return a result for invalid inputs; one that reads them can perform side effects before coercion fails.
For example,
query($v: String = "default") { f(arg: [$v]) }with{"v": null}passes document and variable validation againstf(arg: [String!]!): String, but argument coercion must fail before callingf. This complements #4507, which added the non-null checks themselves.Force the existing memoized argument supplier before invoking either a regular or lightweight data fetcher, inside the existing exception-handling boundary. This preserves field-error handling, null propagation, instrumentation, and DataLoader dispatch. Fields without argument definitions keep lazy environment construction.
Adds 45 Spock cases covering queries, mutation side effects and ordering, subscriptions, nested inputs, property/lightweight fetchers, aliases and list paths, skipped/unreached fields, deferred results, scalar coercion/memoization, exception handlers, and all three DataLoader dispatch modes. On master, 36 of these cases fail; with this change, all 45 pass.
Validation:
./gradlew test testng jacocoTestReporton Java 25 passed (6,223 tests, zero failures, 57 existing skips). The local per-class coverage comparison against the committed baseline found no regressions.Exploratory local JMH comparison with master (Java 25, 2 forks, 3 × 1s warmup, 5 × 1s measurement): a 100-item query took 15.1 → 15.7 µs without arguments, 57.9 → 57.8 µs when fetchers read literal arguments, and 15.8 → 53.8 µs when property fetchers ignored literal arguments. The latter now performs the required coercion. The existing
ExecutionBenchmarkmeasured 269 → 262 µs, within measurement uncertainty. The no-argument path retains its allocation savings but does add the argument-definition check.