Skip to content

Ensure schema inspection always runs once even if the builder is used again #878

Closed
@rstoyanchev

Description

@rstoyanchev

Currently DefaultSchemaResourceGraphQlSourceBuilder registers a Consumer<GraphQL.Builder> callback to run inspection at the end of the build steps. This is because SchemaMappingInspector depends on the following:

  1. Code registrations in the RuntimeWiring, which is available only in DefaultSchemaResourceGraphQlSourceBuilder#initGraphQlSchema.
  2. Access to GraphQLSchema after it is transformed with type visitors which happens later in the base AbstractGraphQlSource.

The approach works fine if the builder is used once, but has the side effect of registering an additional callback with each call to build(), which hasn't been noticed as the builder is normally used once. However, GraphQlSource was always meant to allow resolving the GraphQL and GraphQLSchema at runtime, and we should remove this side effect.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions