Package org.springframework.graphql
Interface ExecutionGraphQlRequest
- All Superinterfaces:
GraphQlRequest
- All Known Implementing Classes:
DefaultExecutionGraphQlRequest
,RSocketGraphQlRequest
,WebGraphQlRequest
,WebSocketGraphQlRequest
Implementation of
GraphQlRequest
for request handling through GraphQL
Java with support for customizing the ExecutionInput
passed into
GraphQL
.- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev, Brian Clozel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureExecutionInput
(BiFunction<ExecutionInput, ExecutionInput.Builder, ExecutionInput> configurer) void
executionId
(ExecutionId executionId) Configure theExecutionId
to set onExecutionInput.getExecutionId()
, overriding the transport assignedid
.Return the configuredexecutionId
.getId()
Return the transport assigned id for the request that in turn setsexecutionId
.Return the transport assigned locale value, if any.Create theExecutionInput
to pass toGraphQL
.Methods inherited from interface org.springframework.graphql.GraphQlRequest
getDocument, getExtensions, getOperationName, getVariables, toMap
-
Method Details
-
getId
String getId()Return the transport assigned id for the request that in turn setsexecutionId
.By default, the id is initialized as follows:
- On WebFlux, this is the
ServerHttpRequest
id which correlates to WebFlux log messages. For Reactor Netty, it also correlates to server log messages. - On Spring MVC, the id is generated via
AlternativeJdkIdGenerator
, which does not correlate to anything, but is more efficient than the defaultExecutionIdProvider
which relies onUUID.randomUUID()
. - On WebSocket, the id is set to the message id of the
"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
executionId(ExecutionId)
or configureGraphQL
with anExecutionIdProvider
.- Returns:
- the request id
- On WebFlux, this is the
-
executionId
Configure theExecutionId
to set onExecutionInput.getExecutionId()
, overriding the transport assignedid
.- Parameters:
executionId
- the id to use
-
getExecutionId
Return the configuredexecutionId
. -
getLocale
Return the transport assigned locale value, if any. -
configureExecutionInput
void configureExecutionInput(BiFunction<ExecutionInput, ExecutionInput.Builder, ExecutionInput> configurer) Provide aBiFunction
to help initialize theExecutionInput
passed toGraphQL
. TheExecutionInput
is first pre-populated with values from "this"ExecutionGraphQlRequest
, and is then customized with the functions provided here.- Parameters:
configurer
- aBiFunction
that accepts theExecutionInput
initialized so far, and a builder to customize it.
-
toExecutionInput
ExecutionInput toExecutionInput()Create theExecutionInput
to pass toGraphQL
. passed toGraphQL
. TheExecutionInput
is populated with values from "this"ExecutionGraphQlRequest
, and then customized with functions provided viaconfigureExecutionInput(BiFunction)
.- Returns:
- the resulting
ExecutionInput
-