Closed
Description
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:
- Code registrations in the
RuntimeWiring
, which is available only inDefaultSchemaResourceGraphQlSourceBuilder#initGraphQlSchema
. - Access to
GraphQLSchema
after it is transformed with type visitors which happens later in the baseAbstractGraphQlSource
.
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.