GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use shared coercion and located errors for @skip and @include by andimarek · Pull Request #4541 · graphql-java/graphql-java

Conversation

@andimarek

@andimarek andimarek commented Nov 6, 2026

Copy link
Copy Markdown
Member

A nullable variable with a non-null default can legally be used in @skip(if:) or @include(if:). Passing explicit null overrides that default and currently causes an uncaught null-unboxing exception:

query ($flag: Boolean = true) {
  good
  parent { child @skip(if: $flag) }
}

With {"flag": null} and a nullable parent, this now returns {"good": ..., "parent": null} plus an error located at $flag, with path ["parent"].

  • Resolve conditional directive arguments through ValuesResolver.getArgumentValues(), reusing the existing Boolean! coercion rules.
  • Report root collection failures with data: null; nested failures preserve siblings and follow normal non-null propagation. Include the directive name, argument source location, and enclosing field path where applicable.
  • Return subscription event errors without terminating the stream, preserving event extensions. Retain the original error during deferred non-null propagation.
  • Preserve Boolean defaults/values, skip short-circuiting, and unknown-variable normalization.

Alternative to #4540: avoids an execution-wide AbortExecutionException. Complements #4522, which handles field arguments before invoking data fetchers; conditional directives are evaluated during field collection.

Validation: 57 new Spock cases cover queries, mutations, fragments, aliases, lists, async fetchers, subscriptions, defer, instrumentation, normalization, and all three DataLoader dispatch modes. ./gradlew --no-daemon test testng jacocoTestReport javadoc passes on Java 25 (6,352 cases, no failures). No per-class coverage regressions against test-baseline.json; the baseline is unchanged.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andimarek
Coerce conditional directive arguments and preserve execution error c…
186e643
…ontext
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 17 6319 (+57 🟢) 6263 (+57 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 21 6319 (+57 🟢) 6263 (+57 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 25 6319 (+57 🟢) 6263 (+57 🟢) 0 (±0) 0 (±0) 56 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 18989 (+171 🟢) 18821 (+171 🟢) 0 (±0) 0 (±0) 168 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 30396 3073 90.8% ±0.0%
Branches 8989 1499 85.7% +0.1% 🟢
Methods 8108 1183 87.3% ±0.0%

Changed Class Coverage (10 classes)

Class Line Branch Method
g.e.c.ConditionalDirectiveCoercionException +100.0% 🟢 +100.0% 🟢 +100.0% 🟢
g.e.c.ConditionalNodes +2.8% 🟢 +4.4% 🟢 ±0.0%
g.e.Execution +0.2% 🟢 ±0.0% ±0.0%
g.e.ExecutionStrategy +0.3% 🟢 +1.0% 🟢 ±0.0%
g.e.FieldCollector ±0.0% +2.6% 🟢 ±0.0%
g.e.i.DeferredFragmentCall ±0.0% +4.2% 🟢 ±0.0%
g.e.SubscriptionExecutionStrategy +0.1% 🟢 +2.8% 🟢 ±0.0%
g.e.ValuesResolver ±0.0% +1.3% 🟢 ±0.0%
g.GraphqlErrorException +27.3% 🟢 ±0.0% +50.0% 🟢
g.GraphqlErrorException
$Builder
+50.0% 🟢 ±0.0% +50.0% 🟢

Full HTML report: build artifact jacoco-html-report

Updated: 2026-11-06 10:08:52 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@andimarek
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.