Skip to content

Improve support for GraphQLSchema transformation #536

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
rstoyanchev opened this issue Nov 16, 2022 · 0 comments
Closed

Improve support for GraphQLSchema transformation #536

rstoyanchev opened this issue Nov 16, 2022 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

The question on generating parts of a schema and runtime wiring dynamically comes up often, see #452 and #532 for example, and that can be done by applying a GraphQLTypeVisitor through a SchemaTransformer.

It is possible to register one or more GraphQLTypeVisitor via GraphQlSource.Builder, but those are applied with SchemaTraverser, which allows only schema traversal (and code registry changes), but not schema changes. That covers a lot of use cases (all of the Spring for GraphQL ones), in a more performance manner. To actually transform the schema with a visitor, one needs to register a schemaFactory instead via GraphQlSource.Builder, but that involves also actually creating the GraphQLSchema, which is not relevant for the transformation.

It would be more convenient to be able to register GraphQLTypeVisitor that should be applied with SchemaTransformer instead of with SchemaTraverser. Perhaps an overloaded typeVisitorsForTransformation method on the GraphQlSource.Builder.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant