Skip to content

Allow empty unions to be completed by extensions#4388

Merged
andimarek merged 1 commit into
masterfrom
test-4200-empty-union-base
May 20, 2026
Merged

Allow empty unions to be completed by extensions#4388
andimarek merged 1 commit into
masterfrom
test-4200-empty-union-base

Conversation

@andimarek
Copy link
Copy Markdown
Member

@andimarek andimarek commented May 19, 2026

Summary

  • Allow SDL union definitions with no base members when union extensions provide members
  • Keep truly empty unions invalid, including directive-only extensions
  • Validate union extension members against the previous effective union so duplicates across the base definition or earlier extensions are rejected
  • Add regression coverage for Empty union base definitions rejected before extensions are merged (spec violation) #4200 and additional draft-spec union extension cases

Fixes #4200

Testing

  • ./gradlew test --tests graphql.schema.idl.SchemaGeneratorTest --tests graphql.schema.idl.SchemaTypeCheckerTest

@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 5831 (+5 🟢) 5775 (+5 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 17 5831 (+5 🟢) 5774 (+5 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 21 5831 (+5 🟢) 5774 (+5 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 25 5831 (+5 🟢) 5774 (+5 🟢) 0 (±0) 0 (±0) 57 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 23356 (+20 🟢) 23129 (+20 🟢) 0 (±0) 0 (±0) 227 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 29580 3131 90.4% ±0.0%
Branches 8679 1533 85.0% ±0.0%
Methods 7905 1210 86.7% ±0.0%

Changed Class Coverage (2 classes)

Class Line Branch Method
g.s.i.SchemaTypeExtensionsChecker +0.5% 🟢 ±0.0% +1.9% 🟢
g.s.i.UnionTypesChecker ±0.0% +7.1% 🟢 ±0.0%

Full HTML report: build artifact jacoco-html-report

Updated: 2026-05-20 00:51:11 UTC

@andimarek andimarek force-pushed the test-4200-empty-union-base branch from d585e69 to da15585 Compare May 20, 2026 00:41
@andimarek andimarek merged commit a53a129 into master May 20, 2026
11 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.

Empty union base definitions rejected before extensions are merged (spec violation)

1 participant