Polishing in GraphQlSource.Builder implementations
This commit is contained in:
@@ -149,27 +149,7 @@ abstract class AbstractGraphQlSourceBuilder<B extends GraphQlSource.Builder<B>>
|
||||
/**
|
||||
* {@link GraphQlSource} with fixed {@link GraphQL} and {@link GraphQLSchema} instances.
|
||||
*/
|
||||
private static class FixedGraphQlSource implements GraphQlSource {
|
||||
|
||||
private final GraphQL graphQl;
|
||||
|
||||
private final GraphQLSchema schema;
|
||||
|
||||
FixedGraphQlSource(GraphQL graphQl, GraphQLSchema schema) {
|
||||
this.graphQl = graphQl;
|
||||
this.schema = schema;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphQL graphQl() {
|
||||
return this.graphQl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphQLSchema schema() {
|
||||
return this.schema;
|
||||
}
|
||||
|
||||
private record FixedGraphQlSource(GraphQL graphQl, GraphQLSchema schema) implements GraphQlSource {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ final class DefaultSchemaResourceGraphQlSourceBuilder
|
||||
|
||||
private final Set<Resource> schemaResources = new LinkedHashSet<>();
|
||||
|
||||
private List<TypeDefinitionConfigurer> typeDefinitionConfigurers = new ArrayList<>();
|
||||
private final List<TypeDefinitionConfigurer> typeDefinitionConfigurers = new ArrayList<>();
|
||||
|
||||
private final List<RuntimeWiringConfigurer> runtimeWiringConfigurers = new ArrayList<>();
|
||||
|
||||
@@ -133,6 +133,9 @@ final class DefaultSchemaResourceGraphQlSourceBuilder
|
||||
}
|
||||
});
|
||||
|
||||
// SchemaMappingInspector needs RuntimeWiring, but cannot run here since type
|
||||
// visitors may transform the schema, for example to add Connection types.
|
||||
|
||||
configureGraphQl(builder -> {
|
||||
GraphQLSchema schema = builder.build().getGraphQLSchema();
|
||||
SchemaMappingInspector.Report report = SchemaMappingInspector.inspect(schema, runtimeWiring);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,7 +29,8 @@ import org.springframework.util.Assert;
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class ExternalSchemaGraphQlSourceBuilder extends AbstractGraphQlSourceBuilder<ExternalSchemaGraphQlSourceBuilder>
|
||||
final class ExternalSchemaGraphQlSourceBuilder
|
||||
extends AbstractGraphQlSourceBuilder<ExternalSchemaGraphQlSourceBuilder>
|
||||
implements GraphQlSource.Builder<ExternalSchemaGraphQlSourceBuilder> {
|
||||
|
||||
private final GraphQLSchema schema;
|
||||
|
||||
Reference in New Issue
Block a user