mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Merge branch '3.1.x' into 3.2.x
This commit is contained in:
commit
c27bb77742
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
@ -25,8 +25,7 @@ import java.util.concurrent.Executor;
|
||||
|
||||
import graphql.GraphQL;
|
||||
import graphql.execution.instrumentation.Instrumentation;
|
||||
import graphql.schema.idl.RuntimeWiring.Builder;
|
||||
import graphql.schema.visibility.NoIntrospectionGraphqlFieldVisibility;
|
||||
import graphql.introspection.Introspection;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@ -108,7 +107,7 @@ public class GraphQlAutoConfiguration {
|
||||
builder.inspectSchemaMappings(logger::info);
|
||||
}
|
||||
if (!properties.getSchema().getIntrospection().isEnabled()) {
|
||||
builder.configureRuntimeWiring(this::enableIntrospection);
|
||||
Introspection.enabledJvmWide(false);
|
||||
}
|
||||
builder.configureTypeDefinitions(new ConnectionTypeDefinitionConfigurer());
|
||||
wiringConfigurers.orderedStream().forEach(builder::configureRuntimeWiring);
|
||||
@ -116,10 +115,6 @@ public class GraphQlAutoConfiguration {
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private Builder enableIntrospection(Builder wiring) {
|
||||
return wiring.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY);
|
||||
}
|
||||
|
||||
private Resource[] resolveSchemaResources(ResourcePatternResolver resolver, String[] locations,
|
||||
String[] extensions) {
|
||||
List<Resource> resources = new ArrayList<>();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
@ -22,12 +22,12 @@ import java.util.concurrent.Executor;
|
||||
import graphql.GraphQL;
|
||||
import graphql.execution.instrumentation.ChainedInstrumentation;
|
||||
import graphql.execution.instrumentation.Instrumentation;
|
||||
import graphql.introspection.Introspection;
|
||||
import graphql.schema.GraphQLObjectType;
|
||||
import graphql.schema.GraphQLOutputType;
|
||||
import graphql.schema.GraphQLSchema;
|
||||
import graphql.schema.idl.RuntimeWiring;
|
||||
import graphql.schema.visibility.DefaultGraphqlFieldVisibility;
|
||||
import graphql.schema.visibility.NoIntrospectionGraphqlFieldVisibility;
|
||||
import org.assertj.core.api.InstanceOfAssertFactories;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@ -181,8 +181,7 @@ class GraphQlAutoConfigurationTests {
|
||||
this.contextRunner.withPropertyValues("spring.graphql.schema.introspection.enabled:false").run((context) -> {
|
||||
GraphQlSource graphQlSource = context.getBean(GraphQlSource.class);
|
||||
GraphQLSchema schema = graphQlSource.schema();
|
||||
assertThat(schema.getCodeRegistry().getFieldVisibility())
|
||||
.isInstanceOf(NoIntrospectionGraphqlFieldVisibility.class);
|
||||
assertThat(Introspection.isEnabledJvmWide()).isFalse();
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user