public class WebOutput extends Object implements ExecutionResult
ExecutionResult
, provide a way to transform
it, and collect input for custom HTTP response headers for GraphQL over HTTP
requests.Modifier and Type | Class and Description |
---|---|
static class |
WebOutput.Builder
Builder to transform a
WebOutput . |
Constructor and Description |
---|
WebOutput(WebInput input,
ExecutionResult executionResult)
Create an instance that wraps the given
ExecutionResult . |
Modifier and Type | Method and Description |
---|---|
<T> T |
getData() |
List<GraphQLError> |
getErrors() |
Map<Object,Object> |
getExtensions() |
HttpHeaders |
getResponseHeaders()
Return a read-only view of any custom headers to be added to the HTTP response, or
null until transform(Consumer) is used to add such headers. |
WebInput |
getWebInput()
Return the associated
WebInput used for the execution. |
boolean |
isDataPresent() |
Map<String,Object> |
toSpecification() |
WebOutput |
transform(Consumer<WebOutput.Builder> consumer)
Transform this
WebOutput instance through a WebOutput.Builder and return a
new instance with the modified values. |
public WebOutput(WebInput input, ExecutionResult executionResult)
ExecutionResult
.input
- the container for the GraphQL inputexecutionResult
- the result of performing a graphql querypublic WebInput getWebInput()
WebInput
used for the execution.@Nullable public <T> T getData()
getData
in interface ExecutionResult
public boolean isDataPresent()
isDataPresent
in interface ExecutionResult
public List<GraphQLError> getErrors()
getErrors
in interface ExecutionResult
@Nullable public Map<Object,Object> getExtensions()
getExtensions
in interface ExecutionResult
public Map<String,Object> toSpecification()
toSpecification
in interface ExecutionResult
@Nullable public HttpHeaders getResponseHeaders()
null
until transform(Consumer)
is used to add such headers.transform(Consumer)
,
WebOutput.Builder.responseHeader(String, String...)
public WebOutput transform(Consumer<WebOutput.Builder> consumer)
WebOutput
instance through a WebOutput.Builder
and return a
new instance with the modified values.consumer
- teh callback that will transform the WebOutput