Skip to content

Commit a22c909

Browse files
committed
Merge pull request #40590 from izeye
* pr/40590: Remove reassignments for builders in GraphQL auto-configurations Closes gh-40590
2 parents 6db8d6f + f0fcc92 commit a22c909

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

Lines changed: 5 additions & 5 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.
@@ -112,15 +112,15 @@ public RouterFunction<ServerResponse> graphQlRouterFunction(GraphQlHttpHandler h
112112
String path = properties.getPath();
113113
logger.info(LogMessage.format("GraphQL endpoint HTTP POST %s", path));
114114
RouterFunctions.Builder builder = RouterFunctions.route();
115-
builder = builder.GET(path, this::onlyAllowPost);
116-
builder = builder.POST(path, SUPPORTS_MEDIATYPES, httpHandler::handleRequest);
115+
builder.GET(path, this::onlyAllowPost);
116+
builder.POST(path, SUPPORTS_MEDIATYPES, httpHandler::handleRequest);
117117
if (properties.getGraphiql().isEnabled()) {
118118
GraphiQlHandler graphQlHandler = new GraphiQlHandler(path, properties.getWebsocket().getPath());
119-
builder = builder.GET(properties.getGraphiql().getPath(), graphQlHandler::handleRequest);
119+
builder.GET(properties.getGraphiql().getPath(), graphQlHandler::handleRequest);
120120
}
121121
if (properties.getSchema().getPrinter().isEnabled()) {
122122
SchemaHandler schemaHandler = new SchemaHandler(graphQlSource);
123-
builder = builder.GET(path + "/schema", schemaHandler::handleRequest);
123+
builder.GET(path + "/schema", schemaHandler::handleRequest);
124124
}
125125
return builder.build();
126126
}

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

Lines changed: 5 additions & 5 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.
@@ -112,16 +112,16 @@ public RouterFunction<ServerResponse> graphQlRouterFunction(GraphQlHttpHandler h
112112
String path = properties.getPath();
113113
logger.info(LogMessage.format("GraphQL endpoint HTTP POST %s", path));
114114
RouterFunctions.Builder builder = RouterFunctions.route();
115-
builder = builder.GET(path, this::onlyAllowPost);
116-
builder = builder.POST(path, RequestPredicates.contentType(MediaType.APPLICATION_JSON)
115+
builder.GET(path, this::onlyAllowPost);
116+
builder.POST(path, RequestPredicates.contentType(MediaType.APPLICATION_JSON)
117117
.and(RequestPredicates.accept(SUPPORTED_MEDIA_TYPES)), httpHandler::handleRequest);
118118
if (properties.getGraphiql().isEnabled()) {
119119
GraphiQlHandler graphiQLHandler = new GraphiQlHandler(path, properties.getWebsocket().getPath());
120-
builder = builder.GET(properties.getGraphiql().getPath(), graphiQLHandler::handleRequest);
120+
builder.GET(properties.getGraphiql().getPath(), graphiQLHandler::handleRequest);
121121
}
122122
if (properties.getSchema().getPrinter().isEnabled()) {
123123
SchemaHandler schemaHandler = new SchemaHandler(graphQlSource);
124-
builder = builder.GET(path + "/schema", schemaHandler::handleRequest);
124+
builder.GET(path + "/schema", schemaHandler::handleRequest);
125125
}
126126
return builder.build();
127127
}

0 commit comments

Comments
 (0)