Add schema universe - #4422
Open
andimarek wants to merge 35 commits into
Open
Conversation
Contributor
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (92 classes)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 aGraphQLSchemaor 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
SchemaUniverse, an append-only chunked vertex arena with stable integer vertex IDs.SUSchemasnapshots backed by persistent integer maps, sharing unchanged adjacency, named-type indexes, implementation indexes, and metadata.GraphQLSchema, SDL, andTypeDefinitionRegistry, as well as exporting back toGraphQLSchema.SUSchemaBuilder, including ordered applied directives and applied directives on directive definitions.cleanupUnusedVertices()for reclaiming vertices unused by registered schemas while preserving stable IDs.Executable schema views
ExecutableSchemaAPI and a schema-neutralSchema*type hierarchy.GraphQLSchemaimplement the new interfaces directly.SUExecutableSchema, an adapter overSUSchemathat provides schema-specific visibility, scalar coercion, enum coercion, introspection, and possible-type behavior.SchemaPrinterto print complete executable schemas and individual schema elements from either representation while preserving the existing GraphQL-specific filtering and comparator APIs.ExecutableSchemaandSchema*elements.Scope
This remains experimental and does not yet replace
GraphQLSchemain request execution. A schema-universe view can currently be printed, parsed/validated against, traversed for field collection, and used for variable/argument/input coercion. WiringGraphQLand execution strategies to execute againstSUExecutableSchemais intentionally left for follow-up work.The current universe import/export also does not preserve execution-only
GraphQLSchemastate such as the code registry.Testing
GraphQLSchemaandSUExecutableSchemapaths.