Skip to content

Improve support for GraphQLSchema transformation #536

Closed

Description

@rstoyanchev

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.

Activity

  1. added this to the 1.1.0 milestone on Nov 16, 2022
  2. self-assigned this
    on Nov 16, 2022
  3. added a commit that references this issue on Feb 13, 2024
    78bdf30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions