mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Merge branch '3.1.x' into 3.2.x
Closes gh-40600
This commit is contained in:
commit
93728cdfb1
@ -112,15 +112,15 @@ public class GraphQlWebFluxAutoConfiguration {
|
||||
String path = properties.getPath();
|
||||
logger.info(LogMessage.format("GraphQL endpoint HTTP POST %s", path));
|
||||
RouterFunctions.Builder builder = RouterFunctions.route();
|
||||
builder = builder.POST(path, SUPPORTS_MEDIATYPES, httpHandler::handleRequest);
|
||||
builder = builder.GET(path, this::onlyAllowPost);
|
||||
builder.POST(path, SUPPORTS_MEDIATYPES, httpHandler::handleRequest);
|
||||
builder.GET(path, this::onlyAllowPost);
|
||||
if (properties.getGraphiql().isEnabled()) {
|
||||
GraphiQlHandler graphQlHandler = new GraphiQlHandler(path, properties.getWebsocket().getPath());
|
||||
builder = builder.GET(properties.getGraphiql().getPath(), graphQlHandler::handleRequest);
|
||||
builder.GET(properties.getGraphiql().getPath(), graphQlHandler::handleRequest);
|
||||
}
|
||||
if (properties.getSchema().getPrinter().isEnabled()) {
|
||||
SchemaHandler schemaHandler = new SchemaHandler(graphQlSource);
|
||||
builder = builder.GET(path + "/schema", schemaHandler::handleRequest);
|
||||
builder.GET(path + "/schema", schemaHandler::handleRequest);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
@ -112,16 +112,16 @@ public class GraphQlWebMvcAutoConfiguration {
|
||||
String path = properties.getPath();
|
||||
logger.info(LogMessage.format("GraphQL endpoint HTTP POST %s", path));
|
||||
RouterFunctions.Builder builder = RouterFunctions.route();
|
||||
builder = builder.POST(path, RequestPredicates.contentType(MediaType.APPLICATION_JSON)
|
||||
builder.POST(path, RequestPredicates.contentType(MediaType.APPLICATION_JSON)
|
||||
.and(RequestPredicates.accept(SUPPORTED_MEDIA_TYPES)), httpHandler::handleRequest);
|
||||
builder = builder.GET(path, this::onlyAllowPost);
|
||||
builder.GET(path, this::onlyAllowPost);
|
||||
if (properties.getGraphiql().isEnabled()) {
|
||||
GraphiQlHandler graphiQLHandler = new GraphiQlHandler(path, properties.getWebsocket().getPath());
|
||||
builder = builder.GET(properties.getGraphiql().getPath(), graphiQLHandler::handleRequest);
|
||||
builder.GET(properties.getGraphiql().getPath(), graphiQLHandler::handleRequest);
|
||||
}
|
||||
if (properties.getSchema().getPrinter().isEnabled()) {
|
||||
SchemaHandler schemaHandler = new SchemaHandler(graphQlSource);
|
||||
builder = builder.GET(path + "/schema", schemaHandler::handleRequest);
|
||||
builder.GET(path + "/schema", schemaHandler::handleRequest);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user