Apply checkstyle changes to spring-graphql-docs
See gh-943
This commit is contained in:
@@ -31,8 +31,8 @@ public class GraphQlConfiguration {
|
||||
@Bean
|
||||
RuntimeWiringConfigurer customWiringConfigurer(BookRepository bookRepository) { // <1>
|
||||
DataFetcher<Book> dataFetcher = QuerydslDataFetcher.builder(bookRepository).single();
|
||||
return wiringBuilder -> wiringBuilder
|
||||
.type("Query", builder -> builder.dataFetcher("book", dataFetcher)); // <2>
|
||||
return (wiringBuilder) -> wiringBuilder
|
||||
.type("Query", (builder) -> builder.dataFetcher("book", dataFetcher)); // <2>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ import org.springframework.web.servlet.function.ServerResponse;
|
||||
@Configuration
|
||||
public class GraphiQlConfiguration {
|
||||
|
||||
@Bean
|
||||
@Order(0)
|
||||
public RouterFunction<ServerResponse> graphiQlRouterFunction() {
|
||||
RouterFunctions.Builder builder = RouterFunctions.route();
|
||||
ClassPathResource graphiQlPage = new ClassPathResource("graphiql/index.html"); // <1>
|
||||
GraphiQlHandler graphiQLHandler = new GraphiQlHandler("/graphql", "", graphiQlPage); // <2>
|
||||
builder = builder.GET("/graphiql", graphiQLHandler::handleRequest); // <3>
|
||||
return builder.build(); // <4>
|
||||
}
|
||||
@Bean
|
||||
@Order(0)
|
||||
public RouterFunction<ServerResponse> graphiQlRouterFunction() {
|
||||
RouterFunctions.Builder builder = RouterFunctions.route();
|
||||
ClassPathResource graphiQlPage = new ClassPathResource("graphiql/index.html"); // <1>
|
||||
GraphiQlHandler graphiQLHandler = new GraphiQlHandler("/graphql", "", graphiQlPage); // <2>
|
||||
builder = builder.GET("/graphiql", graphiQLHandler::handleRequest); // <3>
|
||||
return builder.build(); // <4>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,20 +30,20 @@ class RequestErrorInterceptor implements WebGraphQlInterceptor {
|
||||
|
||||
@Override
|
||||
public Mono<WebGraphQlResponse> intercept(WebGraphQlRequest request, Chain chain) {
|
||||
return chain.next(request).map(response -> {
|
||||
return chain.next(request).map((response) -> {
|
||||
if (response.isValid()) {
|
||||
return response; // <1>
|
||||
}
|
||||
|
||||
List<GraphQLError> errors = response.getErrors().stream() // <2>
|
||||
.map(error -> {
|
||||
.map((error) -> {
|
||||
GraphqlErrorBuilder<?> builder = GraphqlErrorBuilder.newError();
|
||||
// ...
|
||||
return builder.build();
|
||||
})
|
||||
.toList();
|
||||
|
||||
return response.transform(builder -> builder.errors(errors).build()); // <3>
|
||||
return response.transform((builder) -> builder.errors(errors).build()); // <3>
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class ResponseHeaderInterceptor implements WebGraphQlInterceptor {
|
||||
|
||||
@Override
|
||||
public Mono<WebGraphQlResponse> intercept(WebGraphQlRequest request, Chain chain) { // <2>
|
||||
return chain.next(request).doOnNext(response -> {
|
||||
return chain.next(request).doOnNext((response) -> {
|
||||
String value = response.getExecutionInput().getGraphQLContext().get("cookieName");
|
||||
ResponseCookie cookie = ResponseCookie.from("cookieName", value).build();
|
||||
response.getResponseHeaders().add(HttpHeaders.SET_COOKIE, cookie.toString());
|
||||
|
||||
@@ -43,4 +43,4 @@ public class GraphQlRSocketController {
|
||||
public Flux<Map<String, Object>> handleSubscription(Map<String, Object> payload) {
|
||||
return this.handler.handleSubscription(payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user