From eb88697b8359ed0fabbef17d0d87db28688e77eb Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Fri, 21 May 2021 15:34:02 +0100 Subject: [PATCH] Polishing --- .../graphql/boot/WebFluxGraphQlAutoConfiguration.java | 6 ++++-- .../graphql/boot/WebMvcGraphQlAutoConfiguration.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebFluxGraphQlAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebFluxGraphQlAutoConfiguration.java index 5b243f73..f25d427a 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebFluxGraphQlAutoConfiguration.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebFluxGraphQlAutoConfiguration.java @@ -87,9 +87,11 @@ public class WebFluxGraphQlAutoConfiguration { .GET(path, req -> ServerResponse.ok().bodyValue(resource)) .POST(path, accept(MediaType.APPLICATION_JSON).and(contentType(MediaType.APPLICATION_JSON)), handler::handleRequest); if (properties.getSchema().getPrinter().isEnabled()) { - SchemaPrinter schemaPrinter = new SchemaPrinter(); + SchemaPrinter printer = new SchemaPrinter(); builder = builder.GET(path + properties.getSchema().getPrinter().getPath(), - req -> ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).bodyValue(schemaPrinter.print(graphQlSource.schema()))); + req -> ServerResponse.ok() + .contentType(MediaType.TEXT_PLAIN) + .bodyValue(printer.print(graphQlSource.schema()))); } return builder.build(); } diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebMvcGraphQlAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebMvcGraphQlAutoConfiguration.java index 17f43074..494ed10e 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebMvcGraphQlAutoConfiguration.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/WebMvcGraphQlAutoConfiguration.java @@ -93,9 +93,11 @@ public class WebMvcGraphQlAutoConfiguration { .GET(path, req -> ServerResponse.ok().body(resource)) .POST(path, contentType(MediaType.APPLICATION_JSON).and(accept(MediaType.APPLICATION_JSON)), handler::handleRequest); if (properties.getSchema().getPrinter().isEnabled()) { - SchemaPrinter schemaPrinter = new SchemaPrinter(); + SchemaPrinter printer = new SchemaPrinter(); builder = builder.GET(path + properties.getSchema().getPrinter().getPath(), - req -> ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).body(schemaPrinter.print(graphQlSource.schema()))); + req -> ServerResponse.ok() + .contentType(MediaType.TEXT_PLAIN) + .body(printer.print(graphQlSource.schema()))); } return builder.build(); }