Skip to content

Commit e3f8c34

Browse files
committed
Merge branch '3.2.x'
Closes gh-40016
2 parents 9416121 + dc2c253 commit e3f8c34

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfiguration.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525

2626
import graphql.GraphQL;
2727
import graphql.execution.instrumentation.Instrumentation;
28-
import graphql.schema.idl.RuntimeWiring.Builder;
29-
import graphql.schema.visibility.NoIntrospectionGraphqlFieldVisibility;
28+
import graphql.introspection.Introspection;
3029
import org.apache.commons.logging.Log;
3130
import org.apache.commons.logging.LogFactory;
3231

@@ -108,18 +107,14 @@ public GraphQlSource graphQlSource(ResourcePatternResolver resourcePatternResolv
108107
builder.inspectSchemaMappings(logger::info);
109108
}
110109
if (!properties.getSchema().getIntrospection().isEnabled()) {
111-
builder.configureRuntimeWiring(this::enableIntrospection);
110+
Introspection.enabledJvmWide(false);
112111
}
113112
builder.configureTypeDefinitions(new ConnectionTypeDefinitionConfigurer());
114113
wiringConfigurers.orderedStream().forEach(builder::configureRuntimeWiring);
115114
sourceCustomizers.orderedStream().forEach((customizer) -> customizer.customize(builder));
116115
return builder.build();
117116
}
118117

119-
private Builder enableIntrospection(Builder wiring) {
120-
return wiring.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY);
121-
}
122-
123118
private Resource[] resolveSchemaResources(ResourcePatternResolver resolver, String[] locations,
124119
String[] extensions) {
125120
List<Resource> resources = new ArrayList<>();

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfigurationTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
import graphql.GraphQL;
2323
import graphql.execution.instrumentation.ChainedInstrumentation;
2424
import graphql.execution.instrumentation.Instrumentation;
25+
import graphql.introspection.Introspection;
2526
import graphql.schema.GraphQLObjectType;
2627
import graphql.schema.GraphQLOutputType;
2728
import graphql.schema.GraphQLSchema;
2829
import graphql.schema.idl.RuntimeWiring;
2930
import graphql.schema.visibility.DefaultGraphqlFieldVisibility;
30-
import graphql.schema.visibility.NoIntrospectionGraphqlFieldVisibility;
3131
import org.assertj.core.api.InstanceOfAssertFactories;
3232
import org.junit.jupiter.api.Test;
3333
import org.junit.jupiter.api.extension.ExtendWith;
@@ -183,8 +183,7 @@ void shouldDisableFieldIntrospection() {
183183
this.contextRunner.withPropertyValues("spring.graphql.schema.introspection.enabled:false").run((context) -> {
184184
GraphQlSource graphQlSource = context.getBean(GraphQlSource.class);
185185
GraphQLSchema schema = graphQlSource.schema();
186-
assertThat(schema.getCodeRegistry().getFieldVisibility())
187-
.isInstanceOf(NoIntrospectionGraphqlFieldVisibility.class);
186+
assertThat(Introspection.isEnabledJvmWide()).isFalse();
188187
});
189188
}
190189

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ bom {
432432
]
433433
}
434434
}
435-
library("GraphQL Java", "21.3") {
435+
library("GraphQL Java", "21.4") {
436436
prohibit {
437437
startsWith(["2018-", "2019-", "2020-", "2021-", "230521-"])
438438
because "These are snapshots that we don't want to see"

0 commit comments

Comments
 (0)