You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 aSchemaTransformer
.It is possible to register one or more
GraphQLTypeVisitor
viaGraphQlSource.Builder
, but those are applied withSchemaTraverser
, 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 aschemaFactory
instead viaGraphQlSource.Builder
, but that involves also actually creating theGraphQLSchema
, which is not relevant for the transformation.It would be more convenient to be able to register
GraphQLTypeVisitor
that should be applied withSchemaTransformer
instead of withSchemaTraverser
. Perhaps an overloadedtypeVisitorsForTransformation
method on theGraphQlSource.Builder
.The text was updated successfully, but these errors were encountered: