Skip to content

Fix input cycle validation for non-null lists#4386

Merged
andimarek merged 1 commit into
masterfrom
fix-4214-input-list-cycle
May 20, 2026
Merged

Fix input cycle validation for non-null lists#4386
andimarek merged 1 commit into
masterfrom
fix-4214-input-list-cycle

Conversation

@andimarek
Copy link
Copy Markdown
Member

Summary

Verification

  • Confirmed the new regression test fails on current master with: [self!] forms an unsatisfiable cycle
  • ./gradlew test --tests graphql.schema.validation.NoUnbrokenInputCyclesTest
  • ./gradlew test --tests 'graphql.schema.validation.*'

Fixes #4214

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 5828 (+2 🟢) 5772 (+2 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 17 5828 (+2 🟢) 5771 (+2 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 21 5828 (+2 🟢) 5771 (+2 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 25 5828 (+2 🟢) 5771 (+2 🟢) 0 (±0) 0 (±0) 57 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 23344 (+8 🟢) 23117 (+8 🟢) 0 (±0) 0 (±0) 227 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 29551 3130 90.4% ±0.0%
Branches 8669 1533 85.0% ±0.0%
Methods 7892 1210 86.7% ±0.0%

Changed Class Coverage (1 class)

Class Line Branch Method
g.s.v.NoUnbrokenInputCycles +2.6% 🟢 +4.4% 🟢 ±0.0%

Full HTML report: build artifact jacoco-html-report

Updated: 2026-05-20 00:55:07 UTC

@andimarek
Copy link
Copy Markdown
Member Author

Double-checked against the current GraphQL draft spec. Example 83 is exactly the case covered by this PR:

input Example { self: [Example!]! value: String }

The spec says this circular reference is valid because self may be an empty list, and the Input Object type validation rule says a recursive chain is valid when at least one field in the chain is nullable or a List type.

Spec reference: https://spec.graphql.org/draft/#sec-Input-Objects.Circular-References

@andimarek andimarek force-pushed the fix-4214-input-list-cycle branch from b748fb8 to 63cdef1 Compare May 20, 2026 00:31
@andimarek andimarek enabled auto-merge (squash) May 20, 2026 00:34
@andimarek andimarek merged commit 7e0b1c1 into master May 20, 2026
15 of 20 checks passed
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.

Schema generator reports false positive unsatisfiable input object cycle

1 participant