Skip to content

Commit c8aac75

Browse files
wilkinsonaphilwebb
authored andcommitted
Create spring-boot-graphql module
1 parent 9c02495 commit c8aac75

File tree

56 files changed

+192
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+192
-143
lines changed

Diff for: settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ include "spring-boot-project:spring-boot-docs"
7272
include "spring-boot-project:spring-boot-elasticsearch"
7373
include "spring-boot-project:spring-boot-flyway"
7474
include "spring-boot-project:spring-boot-freemarker"
75+
include "spring-boot-project:spring-boot-graphql"
7576
include "spring-boot-project:spring-boot-groovy-templates"
7677
include "spring-boot-project:spring-boot-gson"
7778
include "spring-boot-project:spring-boot-h2console"

Diff for: spring-boot-project/spring-boot-autoconfigure-all/build.gradle

-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ dependencies {
134134
optional("org.springframework.data:spring-data-jdbc")
135135
optional("org.springframework.data:spring-data-mongodb")
136136
optional("org.springframework.data:spring-data-r2dbc")
137-
optional("org.springframework.graphql:spring-graphql")
138137
optional("org.springframework.hateoas:spring-hateoas")
139138
optional("org.springframework.security:spring-security-acl")
140139
optional("org.springframework.security:spring-security-config")
@@ -184,7 +183,6 @@ dependencies {
184183
testImplementation("org.junit.jupiter:junit-jupiter")
185184
testImplementation("org.postgresql:postgresql")
186185
testImplementation("org.postgresql:r2dbc-postgresql")
187-
testImplementation("org.springframework.graphql:spring-graphql-test")
188186
testImplementation("org.springframework.security:spring-security-test")
189187
testImplementation("org.yaml:snakeyaml")
190188

Diff for: spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json

-8
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919
"description": "Whether to enable the PersistenceExceptionTranslationPostProcessor.",
2020
"defaultValue": true
2121
},
22-
{
23-
"name": "spring.graphql.schema.file-extensions",
24-
"defaultValue": ".graphqls,.gqls"
25-
},
26-
{
27-
"name": "spring.graphql.schema.locations",
28-
"defaultValue": "classpath:graphql/**/"
29-
},
3022
{
3123
"name": "spring.http.encoding.charset",
3224
"type": "java.nio.charset.Charset",

Diff for: spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
org.springframework.boot.autoconfigure.aop.AopAutoConfiguration
22
org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration
3-
org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration
4-
org.springframework.boot.autoconfigure.graphql.data.GraphQlReactiveQueryByExampleAutoConfiguration
5-
org.springframework.boot.autoconfigure.graphql.data.GraphQlReactiveQuerydslAutoConfiguration
6-
org.springframework.boot.autoconfigure.graphql.data.GraphQlQueryByExampleAutoConfiguration
7-
org.springframework.boot.autoconfigure.graphql.data.GraphQlQuerydslAutoConfiguration
8-
org.springframework.boot.autoconfigure.graphql.reactive.GraphQlWebFluxAutoConfiguration
9-
org.springframework.boot.autoconfigure.graphql.rsocket.GraphQlRSocketAutoConfiguration
10-
org.springframework.boot.autoconfigure.graphql.rsocket.RSocketGraphQlClientAutoConfiguration
11-
org.springframework.boot.autoconfigure.graphql.security.GraphQlWebFluxSecurityAutoConfiguration
12-
org.springframework.boot.autoconfigure.graphql.security.GraphQlWebMvcSecurityAutoConfiguration
13-
org.springframework.boot.autoconfigure.graphql.servlet.GraphQlWebMvcAutoConfiguration
143
org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration
154
org.springframework.boot.autoconfigure.http.client.reactive.ClientHttpConnectorAutoConfiguration
165
org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration

Diff for: spring-boot-project/spring-boot-docs/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ dependencies {
7979
autoConfiguration(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "autoConfigurationMetadata"))
8080
autoConfiguration(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "autoConfigurationMetadata"))
8181
autoConfiguration(project(path: ":spring-boot-project:spring-boot-freemarker", configuration: "autoConfigurationMetadata"))
82+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-graphql", configuration: "autoConfigurationMetadata"))
8283
autoConfiguration(project(path: ":spring-boot-project:spring-boot-gson", configuration: "autoConfigurationMetadata"))
8384
autoConfiguration(project(path: ":spring-boot-project:spring-boot-h2console", configuration: "autoConfigurationMetadata"))
8485
autoConfiguration(project(path: ":spring-boot-project:spring-boot-hateoas", configuration: "autoConfigurationMetadata"))
@@ -155,6 +156,7 @@ dependencies {
155156
configurationProperties(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "configurationPropertiesMetadata"))
156157
configurationProperties(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "configurationPropertiesMetadata"))
157158
configurationProperties(project(path: ":spring-boot-project:spring-boot-freemarker", configuration: "configurationPropertiesMetadata"))
159+
configurationProperties(project(path: ":spring-boot-project:spring-boot-graphql", configuration: "configurationPropertiesMetadata"))
158160
configurationProperties(project(path: ":spring-boot-project:spring-boot-gson", configuration: "configurationPropertiesMetadata"))
159161
configurationProperties(project(path: ":spring-boot-project:spring-boot-h2console", configuration: "configurationPropertiesMetadata"))
160162
configurationProperties(project(path: ":spring-boot-project:spring-boot-hateoas", configuration: "configurationPropertiesMetadata"))

Diff for: spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/spring-boot-applications.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ There are javadoc:org.springframework.graphql.test.tester.GraphQlTester[] varian
426426

427427
Spring Boot helps you to test your {url-spring-graphql-docs}/controllers.html[Spring GraphQL Controllers] with the javadoc:org.springframework.boot.test.autoconfigure.graphql.GraphQlTest[format=annotation] annotation.
428428
javadoc:org.springframework.boot.test.autoconfigure.graphql.GraphQlTest[format=annotation] auto-configures the Spring GraphQL infrastructure, without any transport nor server being involved.
429-
This limits scanned beans to javadoc:org.springframework.stereotype.Controller[format=annotation], javadoc:org.springframework.graphql.execution.RuntimeWiringConfigurer[], javadoc:org.springframework.boot.jackson.JsonComponent[], javadoc:org.springframework.core.convert.converter.Converter[], javadoc:org.springframework.core.convert.converter.GenericConverter[], javadoc:org.springframework.graphql.execution.DataFetcherExceptionResolver[], javadoc:graphql.execution.instrumentation.Instrumentation[] and javadoc:org.springframework.boot.autoconfigure.graphql.GraphQlSourceBuilderCustomizer[].
429+
This limits scanned beans to javadoc:org.springframework.stereotype.Controller[format=annotation], javadoc:org.springframework.graphql.execution.RuntimeWiringConfigurer[], javadoc:org.springframework.boot.jackson.JsonComponent[], javadoc:org.springframework.core.convert.converter.Converter[], javadoc:org.springframework.core.convert.converter.GenericConverter[], javadoc:org.springframework.graphql.execution.DataFetcherExceptionResolver[], javadoc:graphql.execution.instrumentation.Instrumentation[] and javadoc:org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer[].
430430
Regular javadoc:org.springframework.stereotype.Component[format=annotation] and javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] beans are not scanned when the javadoc:org.springframework.boot.test.autoconfigure.graphql.GraphQlTest[format=annotation] annotation is used.
431431
javadoc:org.springframework.boot.context.properties.EnableConfigurationProperties[format=annotation] can be used to include javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] beans.
432432

Diff for: spring-boot-project/spring-boot-graphql/build.gradle

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot GraphQL"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot"))
13+
api("org.springframework.graphql:spring-graphql")
14+
15+
implementation(project(":spring-boot-project:spring-boot-jackson"))
16+
17+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
18+
optional(project(":spring-boot-project:spring-boot-http"))
19+
optional(project(":spring-boot-project:spring-boot-rsocket"))
20+
optional(project(":spring-boot-project:spring-boot-security"))
21+
optional(project(":spring-boot-project:spring-boot-webflux"))
22+
optional(project(":spring-boot-project:spring-boot-webmvc"))
23+
optional("com.querydsl:querydsl-core")
24+
optional("io.projectreactor.netty:reactor-netty-http")
25+
optional("io.rsocket:rsocket-transport-netty")
26+
optional("jakarta.servlet:jakarta.servlet-api")
27+
optional("jakarta.websocket:jakarta.websocket-api")
28+
optional("jakarta.websocket:jakarta.websocket-client-api")
29+
optional("org.springframework:spring-websocket")
30+
optional("org.springframework.data:spring-data-commons")
31+
32+
testImplementation(project(":spring-boot-project:spring-boot-http-codec"))
33+
testImplementation(project(":spring-boot-project:spring-boot-reactor-netty"))
34+
testImplementation(project(":spring-boot-project:spring-boot-test"))
35+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
36+
testImplementation("org.springframework.graphql:spring-graphql-test")
37+
testImplementation("org.springframework.security:spring-security-test")
38+
39+
testRuntimeOnly("ch.qos.logback:logback-classic")
40+
}
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-2025 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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql;
17+
package org.springframework.boot.graphql.autoconfigure;
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
@@ -29,7 +29,7 @@
2929
* the application, through schema files or infrastructure beans.
3030
*
3131
* @author Brian Clozel
32-
* @since 2.7.0
32+
* @since 4.0.0
3333
*/
3434
@Target({ ElementType.TYPE, ElementType.METHOD })
3535
@Retention(RetentionPolicy.RUNTIME)
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql;
17+
package org.springframework.boot.graphql.autoconfigure;
1818

1919
import java.io.IOException;
2020
import java.util.ArrayList;
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql;
17+
package org.springframework.boot.graphql.autoconfigure;
1818

1919
import java.io.IOException;
2020
import java.util.ArrayList;
@@ -72,7 +72,7 @@
7272
* infrastructure.
7373
*
7474
* @author Brian Clozel
75-
* @since 2.7.0
75+
* @since 4.0.0
7676
*/
7777
@AutoConfiguration
7878
@ConditionalOnClass({ GraphQL.class, GraphQlSource.class })
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql;
17+
package org.springframework.boot.graphql.autoconfigure;
1818

1919
import java.time.Duration;
2020
import java.time.temporal.ChronoUnit;
@@ -32,7 +32,7 @@
3232
*
3333
* @author Andy Wilkinson
3434
* @author Brian Clozel
35-
* @since 2.7.0
35+
* @since 4.0.0
3636
*/
3737
@ConfigurationProperties("spring.graphql.cors")
3838
public class GraphQlCorsProperties {
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql;
17+
package org.springframework.boot.graphql.autoconfigure;
1818

1919
import java.time.Duration;
2020
import java.util.Arrays;
@@ -27,7 +27,7 @@
2727
* {@link ConfigurationProperties Properties} for Spring GraphQL.
2828
*
2929
* @author Brian Clozel
30-
* @since 2.7.0
30+
* @since 4.0.0
3131
*/
3232
@ConfigurationProperties("spring.graphql")
3333
public class GraphQlProperties {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql;
17+
package org.springframework.boot.graphql.autoconfigure;
1818

1919
import org.springframework.graphql.execution.GraphQlSource;
2020

@@ -24,7 +24,7 @@
2424
* Builder} whilst retaining default auto-configuration.
2525
*
2626
* @author Rossen Stoyanchev
27-
* @since 2.7.0
27+
* @since 4.0.0
2828
*/
2929
@FunctionalInterface
3030
public interface GraphQlSourceBuilderCustomizer {
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-2025 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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql.data;
17+
package org.springframework.boot.graphql.autoconfigure.data;
1818

1919
import java.util.Collections;
2020
import java.util.List;
@@ -26,8 +26,8 @@
2626
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
29-
import org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration;
30-
import org.springframework.boot.autoconfigure.graphql.GraphQlSourceBuilderCustomizer;
29+
import org.springframework.boot.graphql.autoconfigure.GraphQlAutoConfiguration;
30+
import org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer;
3131
import org.springframework.context.annotation.Bean;
3232
import org.springframework.data.repository.query.QueryByExampleExecutor;
3333
import org.springframework.graphql.data.query.QueryByExampleDataFetcher;
@@ -41,7 +41,7 @@
4141
* matching return type.
4242
*
4343
* @author Rossen Stoyanchev
44-
* @since 2.7.0
44+
* @since 4.0.0
4545
* @see QueryByExampleDataFetcher#autoRegistrationConfigurer(List, List)
4646
*/
4747
@AutoConfiguration(after = GraphQlAutoConfiguration.class)
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-2025 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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql.data;
17+
package org.springframework.boot.graphql.autoconfigure.data;
1818

1919
import java.util.Collections;
2020
import java.util.List;
@@ -27,8 +27,8 @@
2727
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
30-
import org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration;
31-
import org.springframework.boot.autoconfigure.graphql.GraphQlSourceBuilderCustomizer;
30+
import org.springframework.boot.graphql.autoconfigure.GraphQlAutoConfiguration;
31+
import org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer;
3232
import org.springframework.context.annotation.Bean;
3333
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
3434
import org.springframework.graphql.data.query.QuerydslDataFetcher;
@@ -43,7 +43,7 @@
4343
*
4444
* @author Rossen Stoyanchev
4545
* @author Brian Clozel
46-
* @since 2.7.0
46+
* @since 4.0.0
4747
* @see QuerydslDataFetcher#autoRegistrationConfigurer(List, List)
4848
*/
4949
@AutoConfiguration(after = GraphQlAutoConfiguration.class)
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-2025 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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql.data;
17+
package org.springframework.boot.graphql.autoconfigure.data;
1818

1919
import java.util.Collections;
2020
import java.util.List;
@@ -26,8 +26,8 @@
2626
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
29-
import org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration;
30-
import org.springframework.boot.autoconfigure.graphql.GraphQlSourceBuilderCustomizer;
29+
import org.springframework.boot.graphql.autoconfigure.GraphQlAutoConfiguration;
30+
import org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer;
3131
import org.springframework.context.annotation.Bean;
3232
import org.springframework.data.repository.query.ReactiveQueryByExampleExecutor;
3333
import org.springframework.graphql.data.query.QueryByExampleDataFetcher;
@@ -41,7 +41,7 @@
4141
* matching return type.
4242
*
4343
* @author Rossen Stoyanchev
44-
* @since 2.7.0
44+
* @since 4.0.0
4545
* @see QueryByExampleDataFetcher#autoRegistrationConfigurer(List, List)
4646
*/
4747
@AutoConfiguration(after = GraphQlAutoConfiguration.class)
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-2025 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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.graphql.data;
17+
package org.springframework.boot.graphql.autoconfigure.data;
1818

1919
import java.util.Collections;
2020
import java.util.List;
@@ -27,8 +27,8 @@
2727
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
30-
import org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration;
31-
import org.springframework.boot.autoconfigure.graphql.GraphQlSourceBuilderCustomizer;
30+
import org.springframework.boot.graphql.autoconfigure.GraphQlAutoConfiguration;
31+
import org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer;
3232
import org.springframework.context.annotation.Bean;
3333
import org.springframework.data.querydsl.ReactiveQuerydslPredicateExecutor;
3434
import org.springframework.graphql.data.query.QuerydslDataFetcher;
@@ -43,7 +43,7 @@
4343
*
4444
* @author Rossen Stoyanchev
4545
* @author Brian Clozel
46-
* @since 2.7.0
46+
* @since 4.0.0
4747
* @see QuerydslDataFetcher#autoRegistrationConfigurer(List, List)
4848
*/
4949
@AutoConfiguration(after = GraphQlAutoConfiguration.class)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2025 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.
@@ -17,4 +17,4 @@
1717
/**
1818
* Auto-configuration classes for data integrations with GraphQL.
1919
*/
20-
package org.springframework.boot.autoconfigure.graphql.data;
20+
package org.springframework.boot.graphql.autoconfigure.data;

0 commit comments

Comments
 (0)