Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Closed
rstoyanchev opened this issue Jan 17, 2024 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@rstoyanchev
Copy link
Contributor

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.

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

No branches or pull requests

1 participant