public class DefaultExecutionGraphQlRequest extends DefaultGraphQlRequest implements ExecutionGraphQlRequest
GraphQlRequest
for server side handling, adding the transport (e.g. HTTP
or WebSocket handler) assigned id
and locale
in the addition to the GraphQlRequest
inputs.
Supports the initialization of ExecutionInput
that is passed to
GraphQL
. You can customize that via
configureExecutionInput(BiFunction)
.
Constructor and Description |
---|
DefaultExecutionGraphQlRequest(String document,
String operationName,
Map<String,Object> variables,
Map<String,Object> extensions,
String id,
Locale locale)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
configureExecutionInput(BiFunction<ExecutionInput,ExecutionInput.Builder,ExecutionInput> configurer)
|
void |
executionId(ExecutionId executionId)
Configure the
ExecutionId to set on
ExecutionInput.getExecutionId() , overriding the transport assigned
id . |
ExecutionId |
getExecutionId()
Return the configured
executionId . |
String |
getId()
Return the transport assigned id for the request that in turn sets
executionId . |
Locale |
getLocale()
Return the transport assigned locale value, if any.
|
ExecutionInput |
toExecutionInput()
Create the
ExecutionInput to pass to GraphQL . |
String |
toString() |
equals, getDocument, getExtensions, getOperationName, getVariables, hashCode, toMap
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDocument, getExtensions, getOperationName, getVariables, toMap
public DefaultExecutionGraphQlRequest(String document, @Nullable String operationName, @Nullable Map<String,Object> variables, @Nullable Map<String,Object> extensions, String id, @Nullable Locale locale)
document
- textual representation of the operation(s)operationName
- optionally, the name of the operation to executevariables
- variables by which the query is parameterizedextensions
- implementor specific, protocol extensionsid
- the request id, to be used as the ExecutionId
locale
- the locale associated with the requestpublic String getId()
ExecutionGraphQlRequest
executionId
.
By default, the id is initialized as follows:
ServerHttpRequest
id which correlates
to WebFlux log messages. For Reactor Netty, it also correlates to server
log messages.
AlternativeJdkIdGenerator
, which does
not correlate to anything, but is more efficient than the default
ExecutionIdProvider
which relies on
UUID.randomUUID()
.
"subscribe"
message from the GraphQL over WebSocket protocol that is used to correlate
request and response messages on the the WebSocket.
To override this id, use ExecutionGraphQlRequest.executionId(ExecutionId)
or configure
GraphQL
with an ExecutionIdProvider
.
getId
in interface ExecutionGraphQlRequest
public void executionId(ExecutionId executionId)
ExecutionGraphQlRequest
ExecutionId
to set on
ExecutionInput.getExecutionId()
, overriding the transport assigned
id
.executionId
in interface ExecutionGraphQlRequest
executionId
- the id to use@Nullable public ExecutionId getExecutionId()
ExecutionGraphQlRequest
executionId
.getExecutionId
in interface ExecutionGraphQlRequest
@Nullable public Locale getLocale()
ExecutionGraphQlRequest
getLocale
in interface ExecutionGraphQlRequest
public void configureExecutionInput(BiFunction<ExecutionInput,ExecutionInput.Builder,ExecutionInput> configurer)
ExecutionGraphQlRequest
BiFunction
to help initialize the ExecutionInput
passed to GraphQL
. The ExecutionInput
is first
pre-populated with values from "this" ExecutionGraphQlRequest
, and
is then customized with the functions provided here.configureExecutionInput
in interface ExecutionGraphQlRequest
configurer
- a BiFunction
that accepts the
ExecutionInput
initialized so far, and a builder to customize it.public ExecutionInput toExecutionInput()
ExecutionGraphQlRequest
ExecutionInput
to pass to GraphQL
.
passed to GraphQL
. The ExecutionInput
is populated
with values from "this" ExecutionGraphQlRequest
, and then customized
with functions provided via ExecutionGraphQlRequest.configureExecutionInput(BiFunction)
.toExecutionInput
in interface ExecutionGraphQlRequest
ExecutionInput
public String toString()
toString
in class DefaultGraphQlRequest