GeezerVison is showing github.com — Add schema universe by andimarek · Pull Request #4422 · graphql-java/graphql-java
Conversation
andimarek
commented
Aug 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
This PR introduces an experimental Schema Universe for storing many related GraphQL schemas with structural sharing. It also adds a schema-neutral ExecutableSchema / Schema* view so common schema consumers can operate on either a GraphQLSchema or a schema-universe snapshot without duplicating their core logic.
The implementation is aimed at workloads that derive hundreds or thousands of schemas from a common source through small transformations.
Schema Universe
- Adds
SchemaUniverse, an append-only chunked vertex arena with stable integer vertex IDs.
- Represents relationships as packed primitive edges stored outside vertices.
- Publishes immutable
SUSchema snapshots backed by persistent integer maps, sharing unchanged adjacency, named-type indexes, implementation indexes, and metadata.
- Supports importing from
GraphQLSchema, SDL, and TypeDefinitionRegistry, as well as exporting back to GraphQLSchema.
- Supports schema derivation through
SUSchemaBuilder, including ordered applied directives and applied directives on directive definitions.
- Stores all named types directly in each snapshot and maintains an interface-to-implementations index for efficient possible-type lookups.
- Includes per-schema introspection types, including customized introspection definitions.
- Retains schema and element AST definitions in optional chunk-aligned sidecars.
- Adds sparse, user-controlled metadata keyed by vertex ID on each schema snapshot.
- Defines schema registry lifetime semantics, schema removal, and
cleanupUnusedVertices() for reclaiming vertices unused by registered schemas while preserving stable IDs.
- Adds design documentation and JMH/JOL benchmarks for import, transformation, lookup, and retained-memory analysis.
Executable schema views
- Adds the experimental
ExecutableSchema API and a schema-neutral Schema* type hierarchy.
- Makes
GraphQLSchema implement the new interfaces directly.
- Adds
SUExecutableSchema, an adapter over SUSchema that provides schema-specific visibility, scalar coercion, enum coercion, introspection, and possible-type behavior.
- Generalizes
SchemaPrinter to print complete executable schemas and individual schema elements from either representation while preserving the existing GraphQL-specific filtering and comparator APIs.
- Adds schema-neutral filtering and comparator options with defaults matching the existing GraphQL ordering.
- Generalizes parsing/validation, operation validation, field collection, conditional directives, AST type resolution, and input value coercion to use
ExecutableSchema and Schema* elements.
- Keeps the existing GraphQL-specific public overloads and behavior intact; they delegate to the shared implementation where appropriate.
Scope
This remains experimental and does not yet replace GraphQLSchema in request execution. A schema-universe view can currently be printed, parsed/validated against, traversed for field collection, and used for variable/argument/input coercion. Wiring GraphQL and execution strategies to execute against SUExecutableSchema is intentionally left for follow-up work.
The current universe import/export also does not preserve execution-only GraphQLSchema state such as the code registry.
Testing
- Adds focused tests for packed edges, persistent maps, schema construction/transformation, cleanup, metadata, ordered directives, AST retention, implementations, possible types, introspection, and round trips.
- Runs schema printing, validation, field collection, conditional-node handling, and value coercion against both
GraphQLSchema and SUExecutableSchema paths.
- The full local test suite passes (6,093 tests).
- CI passes on Java 11, 17, 21, and 25, including the per-class coverage guard and jcstress.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Test Report
Test Results
| Java Version |
Total |
Passed |
Failed |
Errors |
Skipped |
| Java 11 |
6093 (+166 🟢) |
6036 (+165 🟢) |
0 (±0) |
0 (±0) |
57 (+1) |
| Java 17 |
6093 (+166 🟢) |
6035 (+165 🟢) |
0 (±0) |
0 (±0) |
58 (+1) |
| Java 21 |
6093 (+166 🟢) |
6035 (+165 🟢) |
0 (±0) |
0 (±0) |
58 (+1) |
| Java 25 |
6093 (+166 🟢) |
6035 (+165 🟢) |
0 (±0) |
0 (±0) |
58 (+1) |
| jcstress |
32 (±0) |
32 (±0) |
0 (±0) |
0 (±0) |
0 (±0) |
| Total |
24404 (+664 🟢) |
24173 (+660 🟢) |
0 (±0) |
0 (±0) |
231 (+4) |
Code Coverage (Java 25)
| Metric |
Covered |
Missed |
Coverage |
vs Master |
| Lines |
33593 |
3193 |
91.3% |
+0.7% 🟢 |
| Branches |
10100 |
1679 |
85.7% |
+0.5% 🟢 |
| Methods |
8819 |
1223 |
87.8% |
+0.9% 🟢 |
Changed Class Coverage (92 classes)
| Class |
Line |
Branch |
Method |
| g.e.InputMapDefinesTooManyFieldsException |
+10.7% 🟢 |
±0.0% |
+8.3% 🟢 |
| g.e.MergedSelectionSet |
+8.3% 🟢 |
±0.0% |
+11.1% 🟢 |
| g.e.NonNullableValueCoercedAsNullException |
+12.2% 🟢 |
±0.0% |
+10.4% 🟢 |
| g.e.TypeFromAST |
+7.7% 🟢 |
±0.0% |
+30.0% 🟢 |
| g.e.v.InputInterceptor |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.e.v.l.LegacyCoercingInputInterceptor |
+1.5% 🟢 |
+2.6% 🟢 |
±0.0% |
| g.e.ValuesResolver |
+0.2% 🟢 |
+0.2% 🟢 |
+1.3% 🟢 |
| g.e.ValuesResolverConversion |
+3.6% 🟢 |
+5.1% 🟢 |
+7.7% 🟢 |
| g.e.ValuesResolverLegacy |
±0.0% |
+2.8% 🟢 |
±0.0% |
| g.e.ValuesResolverOneOfValidation |
+1.7% 🟢 |
+0.7% 🟢 |
+2.4% 🟢 |
| g.l.AstPrinter |
+0.6% 🟢 |
+0.9% 🟢 |
±0.0% |
| g.ParseAndValidate |
+3.9% 🟢 |
±0.0% |
+0.5% 🟢 |
| g.s.GraphQLAppliedDirective |
+2.9% 🟢 |
±0.0% |
+6.3% 🟢 |
| g.s.GraphQLAppliedDirectiveArgument |
+3.0% 🟢 |
±0.0% |
+5.3% 🟢 |
g.s.GraphQLArgument $Builder |
+4.3% 🟢 |
±0.0% |
+4.8% 🟢 |
| g.s.GraphQLEnumType |
+3.5% 🟢 |
+4.2% 🟢 |
+2.7% 🟢 |
g.s.GraphQLInputObjectField $Builder |
+5.3% 🟢 |
±0.0% |
+5.6% 🟢 |
| g.s.GraphQLSchema |
+1.1% 🟢 |
+5.2% 🟢 |
+1.3% 🟢 |
| g.s.GraphQLTypeReference |
+2.3% 🟢 |
±0.0% |
+4.2% 🟢 |
| g.s.GraphQLTypeUtil |
+2.5% 🟢 |
+2.2% 🟢 |
+1.4% 🟢 |
| g.s.i.SchemaPrinter |
±0.0% |
+3.3% 🟢 |
+1.3% 🟢 |
g.s.i.SchemaPrinter $Options |
+0.4% 🟢 |
±0.0% |
+0.5% 🟢 |
| g.s.i.SchemaTypeExtensionsChecker |
+0.5% 🟢 |
±0.0% |
+1.5% 🟢 |
| g.s.i.TypeDefinitionRegistry |
+0.3% 🟢 |
±0.0% |
+1.3% 🟢 |
| g.s.SchemaElementComparatorEnvironment |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.SchemaElementComparatorRegistry |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.SchemaElementComparators |
+96.4% 🟢 |
+94.4% 🟢 |
+100.0% 🟢 |
| g.s.u.IntMapBranch |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.IntMapLeaf |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.MutablePackedEdgeSet |
+99.1% 🟢 |
+93.9% 🟢 |
+100.0% 🟢 |
| g.s.u.PackedEdgeSet |
+100.0% 🟢 |
+91.2% 🟢 |
+100.0% 🟢 |
| g.s.u.PersistentEdgeMap |
+96.2% 🟢 |
+87.5% 🟢 |
+100.0% 🟢 |
| g.s.u.PersistentIntMap |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.SchemaUniverse |
+98.8% 🟢 |
+85.1% 🟢 |
+97.4% 🟢 |
| g.s.u.SUAppliedDirective |
+91.7% 🟢 |
+83.3% 🟢 |
+100.0% 🟢 |
| g.s.u.SUAppliedDirectiveArgument |
+92.3% 🟢 |
±0.0% |
+85.7% 🟢 |
| g.s.u.SUArgument |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUAstDefinitions |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUCompositeType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUDirective |
+100.0% 🟢 |
+87.5% 🟢 |
+100.0% 🟢 |
| g.s.u.SUEdgeKind |
+100.0% 🟢 |
+62.5% 🟢 |
+100.0% 🟢 |
| g.s.u.SUEnumType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUEnumValue |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUExporter |
+95.8% 🟢 |
+82.4% 🟢 |
+97.4% 🟢 |
| g.s.u.SUField |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUImporter |
+97.0% 🟢 |
+77.9% 🟢 |
+100.0% 🟢 |
| g.s.u.SUInputField |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUInputObjectType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUInterfaceType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUIntrospectionSchemaType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUListType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUNamedType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUNonNullType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUObjectType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUScalarType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUSchema |
+100.0% 🟢 |
+92.3% 🟢 |
+100.0% 🟢 |
| g.s.u.SUSchemaBuilder |
+97.0% 🟢 |
+83.5% 🟢 |
+90.8% 🟢 |
| g.s.u.SUSchemaGenerator |
+95.1% 🟢 |
+89.2% 🟢 |
+100.0% 🟢 |
| g.s.u.SUSchemaOptions |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.SUSchemaRoot |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUUnionType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.SUVertex |
+100.0% 🟢 |
+50.0% 🟢 |
+100.0% 🟢 |
| g.s.u.SUVertexKind |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.VertexChunk |
+100.0% 🟢 |
+94.4% 🟢 |
+100.0% 🟢 |
| g.s.u.v.AbstractSUSchemaElement |
+94.1% 🟢 |
+100.0% 🟢 |
+85.7% 🟢 |
| g.s.u.v.AbstractSUSchemaNamedType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.v.AbstractSUSchemaType |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.v.SUExecutableSchema |
+97.3% 🟢 |
+91.9% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUExecutableSchemaBuilder |
+100.0% 🟢 |
+86.4% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUSchemaAppliedDirective |
+94.7% 🟢 |
+75.0% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUSchemaAppliedDirectiveArgument |
+90.0% 🟢 |
±0.0% |
+83.3% 🟢 |
| g.s.u.v.SUSchemaArgument |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.v.SUSchemaDirective |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUSchemaEnum |
+84.8% 🟢 |
+66.7% 🟢 |
+91.7% 🟢 |
| g.s.u.v.SUSchemaEnumValue |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.v.SUSchemaField |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUSchemaInputField |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.v.SUSchemaInputObject |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUSchemaInterface |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUSchemaIntrospectionArgument |
+72.7% 🟢 |
±0.0% |
+62.5% 🟢 |
| g.s.u.v.SUSchemaIntrospectionField |
+88.0% 🟢 |
+100.0% 🟢 |
+70.0% 🟢 |
| g.s.u.v.SUSchemaList |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.v.SUSchemaNonNull |
+100.0% 🟢 |
±0.0% |
+100.0% 🟢 |
| g.s.u.v.SUSchemaObject |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUSchemaScalar |
+85.7% 🟢 |
+58.3% 🟢 |
+100.0% 🟢 |
| g.s.u.v.SUSchemaUnion |
+100.0% 🟢 |
+100.0% 🟢 |
+100.0% 🟢 |
| g.s.v.AppliedDirectiveArgumentsAreValid |
+5.1% 🟢 |
+4.5% 🟢 |
±0.0% |
| g.s.v.NoDefaultValueCircularRefs |
+1.1% 🟢 |
+3.3% 🟢 |
±0.0% |
| g.v.OperationValidator |
+0.4% 🟢 |
+0.3% 🟢 |
±0.0% |
| g.v.ValidationUtil |
+1.0% 🟢 |
+0.1% 🟢 |
±0.0% |
| g.v.VariablesTypesMatcher |
+12.1% 🟢 |
+3.1% 🟢 |
±0.0% |
Full HTML report: build artifact jacoco-html-report
Updated: 2026-08-09 00:42:34 UTC
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
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.
|