Skip to content

Add support for @semanticNonNull#4401

Draft
martinbonnin wants to merge 1 commit into
graphql-java:masterfrom
martinbonnin:semantic-non-null
Draft

Add support for @semanticNonNull#4401
martinbonnin wants to merge 1 commit into
graphql-java:masterfrom
martinbonnin:semantic-non-null

Conversation

@martinbonnin
Copy link
Copy Markdown
Contributor

@semanticNonNull is the counterpart of onError.

  • onError is aimed to be merged in the spec and allow new services to use true nullability (!) without conflating nulls and errors.
  • @semanticNonNull is for the transition. It allows existing services that cannot change fields to non-nullable (!) because that would increase the blast radius of errors for older clients to still signal semantic nullability to newer clients.

See the @semanticNonNull GAP for more details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 5890 (+9 🟢) 5834 (+9 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 17 5890 (+9 🟢) 5833 (+9 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 21 5890 (+9 🟢) 5833 (+9 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 25 5890 (+9 🟢) 5833 (+9 🟢) 0 (±0) 0 (±0) 57 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 23592 (+36 🟢) 23365 (+36 🟢) 0 (±0) 0 (±0) 227 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 29751 3131 90.5% ±0.0%
Branches 8744 1536 85.1% ±0.0%
Methods 7934 1210 86.8% ±0.0%

Changed Class Coverage (4 classes)

Class Line Branch Method
g.Directives +0.1% 🟢 ±0.0% +3.2% 🟢
g.e.NonNullableFieldValidator -2.2% 🔴 -15.4% 🔴 ±0.0%
g.e.ResultPath +1.9% 🟢 ±0.0% +6.7% 🟢
g.e.SemanticNonNullFieldWasNullError +70.0% 🟢 ±0.0% +50.0% 🟢
NonNullableFieldValidator — method details
Method Line Branch
checkSemanticNonNull new 100.0% 100.0%
listLevel new 100.0% 75.0%
semanticNonNullLevels new 83.3% 50.0%
addError new 100.0% 100.0%
<clinit> new 100.0%

Full HTML report: build artifact jacoco-html-report

Updated: 2026-06-02 16:56:51 UTC

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant