public class WebGraphQlResponse extends DefaultExecutionGraphQlResponse
GraphQlResponse
implementation for server
handling over HTTP or over WebSocket.Modifier and Type | Class and Description |
---|---|
static class |
WebGraphQlResponse.Builder
Builder to transform a
WebGraphQlResponse . |
Constructor and Description |
---|
WebGraphQlResponse(ExecutionGraphQlResponse response)
Create an instance that wraps the given
ExecutionGraphQlResponse . |
Modifier and Type | Method and Description |
---|---|
HttpHeaders |
getResponseHeaders()
Return the headers to be added to the HTTP response.
|
WebGraphQlResponse |
transform(Consumer<WebGraphQlResponse.Builder> consumer)
Transform the underlying
ExecutionResult through a WebGraphQlResponse.Builder
and return a new instance with the modified values. |
getData, getErrors, getExecutionInput, getExecutionResult, getExtensions, isValid, toMap, toString
field
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
field
public WebGraphQlResponse(ExecutionGraphQlResponse response)
ExecutionGraphQlResponse
.response
- the response to wrappublic HttpHeaders getResponseHeaders()
By default, this is empty.
Note: This is for use with GraphQL over HTTP requests but not for GraphQL over WebSocket where the initial handshake HTTP request completes before queries begin.
public WebGraphQlResponse transform(Consumer<WebGraphQlResponse.Builder> consumer)
ExecutionResult
through a WebGraphQlResponse.Builder
and return a new instance with the modified values.consumer
- callback to transform the resultExecutionResult