Package graphql
Class ExecutionInput.Builder
java.lang.Object
graphql.ExecutionInput.Builder
- Enclosing class:
ExecutionInput
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object
private org.dataloader.DataLoaderRegistry
private ExecutionId
private GraphQLContext
private Object
private Locale
private String
private String
private RawVariables
private Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
context
(GraphQLContext.Builder contextBuilder) Deprecated.Deprecated.- theExecutionInput.getGraphQLContext()
is a fixed mutable instance nowcontext
(UnaryOperator<GraphQLContext.Builder> contextBuilderFunction) Deprecated.- theExecutionInput.getGraphQLContext()
is a fixed mutable instance nowdataLoaderRegistry
(org.dataloader.DataLoaderRegistry dataLoaderRegistry) You should create newDataLoaderRegistry
s and newDataLoader
s for each execution.executionId
(ExecutionId executionId) A default one will be assigned, but you can set your own.extensions
(Map<String, Object> extensions) graphQLContext
(Consumer<GraphQLContext.Builder> builderFunction) This will give you a builder ofGraphQLContext
and any values you set will be copied into the underlyingGraphQLContext
of this execution inputgraphQLContext
(Map<?, Object> mapOfContext) This will put all the values from the map into the underlyingGraphQLContext
of this execution inputlocalContext
(Object localContext) Sets initial localContext in root data fetchersSets the locale to use for this operationoperationName
(String operationName) private ExecutionInput.Builder
transfer
(GraphQLContext graphQLContext) Adds raw (not coerced) variables
-
Field Details
-
query
-
operationName
-
graphQLContext
-
context
-
localContext
-
root
-
rawVariables
-
extensions
-
dataLoaderRegistry
private org.dataloader.DataLoaderRegistry dataLoaderRegistry -
locale
-
executionId
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
query
-
operationName
-
executionId
A default one will be assigned, but you can set your own.- Parameters:
executionId
- an execution id object- Returns:
- this builder
-
locale
Sets the locale to use for this operation- Parameters:
locale
- the locale to use- Returns:
- this builder
-
localContext
Sets initial localContext in root data fetchers- Parameters:
localContext
- the local context to use- Returns:
- this builder
-
context
Deprecated.- theExecutionInput.getGraphQLContext()
is a fixed mutable instance nowThe legacy context object- Parameters:
context
- the context object to use- Returns:
- this builder
-
context
Deprecated.- theExecutionInput.getGraphQLContext()
is a fixed mutable instance nowThe legacy context object- Parameters:
contextBuilder
- the context builder object to use- Returns:
- this builder
-
context
@Deprecated public ExecutionInput.Builder context(UnaryOperator<GraphQLContext.Builder> contextBuilderFunction) Deprecated.- theExecutionInput.getGraphQLContext()
is a fixed mutable instance nowThe legacy context object- Parameters:
contextBuilderFunction
- the context builder function to use- Returns:
- this builder
-
graphQLContext
This will give you a builder ofGraphQLContext
and any values you set will be copied into the underlyingGraphQLContext
of this execution input- Parameters:
builderFunction
- a builder function you can use to put values into the context- Returns:
- this builder
-
graphQLContext
This will put all the values from the map into the underlyingGraphQLContext
of this execution input- Parameters:
mapOfContext
- a map of values to put in the context- Returns:
- this builder
-
transfer
-
root
-
variables
Adds raw (not coerced) variables- Parameters:
rawVariables
- the map of raw variables- Returns:
- this builder
-
extensions
-
dataLoaderRegistry
public ExecutionInput.Builder dataLoaderRegistry(org.dataloader.DataLoaderRegistry dataLoaderRegistry) You should create newDataLoaderRegistry
s and newDataLoader
s for each execution. Do not re-use instances as this will create unexpected results.- Parameters:
dataLoaderRegistry
- a registry ofDataLoader
s- Returns:
- this builder
-
build
-
ExecutionInput.getGraphQLContext()
is a fixed mutable instance now