spring-graphql/src/main/java/org/springframework/graphql/server/webmvc/GraphQlHttpHandler.java
/**
	 * Handle GraphQL requests over HTTP.
	 * @param serverRequest the incoming HTTP request
	 * @return the HTTP response
	 * @throws ServletException may be raised when reading the request body, e.g.
	 * {@link HttpMediaTypeNotSupportedException}.
	 */
Handle GraphQL requests over HTTP.
@param serverRequest the incoming HTTP request
@return the HTTP response
@throws ServletException may be raised when reading the request body, e.g.
Handle GraphQL requests over HTTP . @param serverRequest the incoming HTTP request @return the HTTP response @throws ServletException may be raised when reading the request body e . g .
public ServerResponse handleRequest(ServerRequest serverRequest) throws ServletException {
		WebGraphQlRequest graphQlRequest = new WebGraphQlRequest(
				serverRequest.uri(), serverRequest.headers().asHttpHeaders(), readBody(serverRequest),
				this.idGenerator.generateId().toString(), LocaleContextHolder.getLocale());
		if (logger.isDebugEnabled()) {
			logger.debug("Executing: " + graphQlRequest);
		}
		Mono<ServerResponse> responseMono = this.graphQlHandler.handleRequest(graphQlRequest)
				.map(response -> {
					if (logger.isDebugEnabled()) {
						logger.debug("Execution complete");
					}
					ServerResponse.BodyBuilder builder = ServerResponse.ok();
					builder.headers(headers -> headers.putAll(response.getResponseHeaders()));
					return builder.body(response.toMap());
				});
		return ServerResponse.async(responseMono);
	}
public ServerResponse handleRequest ( ServerRequest serverRequest ) throws ServletException { WebGraphQlRequest graphQlRequest = new WebGraphQlRequest ( serverRequest . uri ( ) , serverRequest . headers ( ) . asHttpHeaders ( ) , readBody ( serverRequest ) , this . idGenerator . generateId ( ) . toString ( ) , LocaleContextHolder . getLocale ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Executing: " + graphQlRequest ) ; } Mono < ServerResponse > responseMono = this . graphQlHandler . handleRequest ( graphQlRequest ) . map ( response -> { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Execution complete" ) ; } ServerResponse . BodyBuilder builder = ServerResponse . ok ( ) ; builder . headers ( headers -> headers . putAll ( response . getResponseHeaders ( ) ) ) ; return builder . body ( response . toMap ( ) ) ; } ) ; return ServerResponse . async ( responseMono ) ; }
Handle GraphQL requests over HTTP.
Handle GraphQL requests over HTTP .