GeezerVison is showing github.com — Backport 26.1: validate circular default values by andimarek · Pull Request #4450 · graphql-java/graphql-java
Conversation
andimarek
commented
Aug 20, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Backport of #4253 to the 26.x maintenance branch.
Input object fields can define default values in ways that form cycles. For example:
input A { b: B = {} }
input B { a: A = {} }
The defaults form an infinitely expanding value. This PR implements the specification InputObjectDefaultValueHasCycle validation so these schemas are rejected during schema validation instead of overflowing while defaults are coerced.
Implementation notes:
- Uses one shared traversal for literal and programmatic defaults.
- Supports the same programmatic list representations as GraphQL Java coercion, including Java arrays.
- Detects cycles before external argument and field defaults are coerced.
- Creates fresh validation-rule instances for each schema-validation run.
- Consolidates the SDL cases into data-driven tests and removes the duplicate integration test class.
This behavior matches the GraphQL specification and graphql-js v17 implementation:
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
* init
* improve spec alignment
* Avoid unnecessary circular default validation work
---------
Co-authored-by: Andreas Marek <[email protected]>
Test Report
Test Results
| Java Version |
Total |
Passed |
Failed |
Errors |
Skipped |
| Java 11 |
- |
- |
- |
- |
- |
| Java 17 |
- |
- |
- |
- |
- |
| Java 21 |
- |
- |
- |
- |
- |
| Java 25 |
- |
- |
- |
- |
- |
| jcstress |
- |
- |
- |
- |
- |
Updated: 2026-08-23 22:52:01 UTC
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.