Add `onError` request parameter by martinbonnin · Pull Request #4378 · graphql-java/graphql-java
Conversation
I'm opening this as a heads up: see graphql/graphql-spec#1163
Not sure we want to merge is now since it's not in graphql-js yet and the @experimental_disableErrorPropagation directive still gets the job done for now. But looks like this is the direction we're taking.
Test Report
Test Results
| Java Version | Total | Passed | Failed | Errors | Skipped |
|---|---|---|---|---|---|
| Java 11 | 5885 (+4 🟢) | 5829 (+4 🟢) | 0 (±0) | 0 (±0) | 56 (±0) |
| Java 17 | 5885 (+4 🟢) | 5828 (+4 🟢) | 0 (±0) | 0 (±0) | 57 (±0) |
| Java 21 | 5885 (+4 🟢) | 5828 (+4 🟢) | 0 (±0) | 0 (±0) | 57 (±0) |
| Java 25 | 5885 (+4 🟢) | 5828 (+4 🟢) | 0 (±0) | 0 (±0) | 57 (±0) |
| jcstress | 32 (±0) | 32 (±0) | 0 (±0) | 0 (±0) | 0 (±0) |
| Total | 23572 (+16 🟢) | 23345 (+16 🟢) | 0 (±0) | 0 (±0) | 227 (±0) |
Code Coverage (Java 25)
| Metric | Covered | Missed | Coverage | vs Master |
|---|---|---|---|---|
| Lines | 29698 | 3129 | 90.5% | ±0.0% |
| Branches | 8736 | 1532 | 85.1% | ±0.0% |
| Methods | 7928 | 1209 | 86.8% | ±0.0% |
Changed Class Coverage (2 classes)
| Class | Line | Branch | Method |
|---|---|---|---|
| g.e.Execution | +0.3% 🟢 | +3.5% 🟢 | ±0.0% |
| g.e.OnError | +100.0% 🟢 | ±0.0% | +100.0% 🟢 |
Full HTML report: build artifact
jacoco-html-report
Updated: 2026-06-01 10:00:46 UTC
One possible approach might be to "maintain" the old directive WHILE adding the new ExecutionInput based approach.
That way anyone who has used the old will be able to migrate to the new without breaking. This will cost time and complexity of course but it will be "less impactful" to current users
That said - at what point is the kill date? One could argue it was "experimental" and hence the kill date is immediate as this PR has done
@bbakerman agreed, I'll split this PR in 2 so we can have both at the same time.
Edit: added back @experimental_disableErrorPropagation in e91ba02, will do the PR to remove @experimental_disableErrorPropagation when needed
martinbonnin
changed the title
Replace
Add @experimental_disableErrorPropagation with onError parameteronError request parameter