Skip to content

Commit 7eb155d

Browse files
committed
Upgrade to GraphQL Java 20.8
Closes gh-40020
1 parent 565f440 commit 7eb155d

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,7 @@
2424

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

@@ -102,18 +101,14 @@ public GraphQlSource graphQlSource(ResourcePatternResolver resourcePatternResolv
102101
.subscriptionExceptionResolvers(subscriptionExceptionResolvers.orderedStream().toList())
103102
.instrumentation(instrumentations.orderedStream().toList());
104103
if (!properties.getSchema().getIntrospection().isEnabled()) {
105-
builder.configureRuntimeWiring(this::enableIntrospection);
104+
Introspection.enabledJvmWide(false);
106105
}
107106
builder.configureTypeDefinitions(new ConnectionTypeDefinitionConfigurer());
108107
wiringConfigurers.orderedStream().forEach(builder::configureRuntimeWiring);
109108
sourceCustomizers.orderedStream().forEach((customizer) -> customizer.customize(builder));
110109
return builder.build();
111110
}
112111

113-
private Builder enableIntrospection(Builder wiring) {
114-
return wiring.fieldVisibility(NoIntrospectionGraphqlFieldVisibility.NO_INTROSPECTION_FIELD_VISIBILITY);
115-
}
116-
117112
private Resource[] resolveSchemaResources(ResourcePatternResolver resolver, String[] locations,
118113
String[] extensions) {
119114
List<Resource> resources = new ArrayList<>();

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,12 +21,12 @@
2121
import graphql.GraphQL;
2222
import graphql.execution.instrumentation.ChainedInstrumentation;
2323
import graphql.execution.instrumentation.Instrumentation;
24+
import graphql.introspection.Introspection;
2425
import graphql.schema.GraphQLObjectType;
2526
import graphql.schema.GraphQLOutputType;
2627
import graphql.schema.GraphQLSchema;
2728
import graphql.schema.idl.RuntimeWiring;
2829
import graphql.schema.visibility.DefaultGraphqlFieldVisibility;
29-
import graphql.schema.visibility.NoIntrospectionGraphqlFieldVisibility;
3030
import org.assertj.core.api.InstanceOfAssertFactories;
3131
import org.junit.jupiter.api.Test;
3232

@@ -170,8 +170,7 @@ void shouldDisableFieldIntrospection() {
170170
this.contextRunner.withPropertyValues("spring.graphql.schema.introspection.enabled:false").run((context) -> {
171171
GraphQlSource graphQlSource = context.getBean(GraphQlSource.class);
172172
GraphQLSchema schema = graphQlSource.schema();
173-
assertThat(schema.getCodeRegistry().getFieldVisibility())
174-
.isInstanceOf(NoIntrospectionGraphqlFieldVisibility.class);
173+
assertThat(Introspection.isEnabledJvmWide()).isFalse();
175174
});
176175
}
177176

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ bom {
320320
]
321321
}
322322
}
323-
library("GraphQL Java", "20.2") {
323+
library("GraphQL Java", "20.8") {
324324
group("com.graphql-java") {
325325
modules = [
326326
"graphql-java"

0 commit comments

Comments
 (0)