Package graphql
Class ExecutionInput.Builder
- java.lang.Object
-
- graphql.ExecutionInput.Builder
-
- Enclosing class:
- ExecutionInput
public static class ExecutionInput.Builder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.String,java.lang.Object>
extensions
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ExecutionInput
build()
ExecutionInput.Builder
context(java.lang.Object context)
Deprecated.- theExecutionInput.getGraphQLContext()
is a fixed mutable instance nowExecutionInput.Builder
dataLoaderRegistry(org.dataloader.DataLoaderRegistry dataLoaderRegistry)
You should create newDataLoaderRegistry
s and newDataLoader
s for each execution.ExecutionInput.Builder
executionId(ExecutionId executionId)
A default one will be assigned, but you can set your own.ExecutionInput.Builder
extensions(java.util.Map<java.lang.String,java.lang.Object> extensions)
ExecutionInput.Builder
graphQLContext(java.util.function.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 inputExecutionInput.Builder
graphQLContext(java.util.Map<?,java.lang.Object> mapOfContext)
This will put all the values from the map into the underlyingGraphQLContext
of this execution inputExecutionInput.Builder
localContext(java.lang.Object localContext)
Sets initial localContext in root data fetchersExecutionInput.Builder
locale(java.util.Locale locale)
Sets the locale to use for this operationExecutionInput.Builder
operationName(java.lang.String operationName)
ExecutionInput.Builder
query(java.lang.String query)
ExecutionInput.Builder
root(java.lang.Object root)
ExecutionInput.Builder
variables(java.util.Map<java.lang.String,java.lang.Object> rawVariables)
Adds raw (not coerced) variables
-
-
-
Method Detail
-
query
public ExecutionInput.Builder query(java.lang.String query)
-
operationName
public ExecutionInput.Builder operationName(java.lang.String operationName)
-
executionId
public ExecutionInput.Builder executionId(ExecutionId executionId)
A default one will be assigned, but you can set your own.- Parameters:
executionId
- an execution id object- Returns:
- this builder
-
locale
public ExecutionInput.Builder locale(java.util.Locale locale)
Sets the locale to use for this operation- Parameters:
locale
- the locale to use- Returns:
- this builder
-
localContext
public ExecutionInput.Builder localContext(java.lang.Object localContext)
Sets initial localContext in root data fetchers- Parameters:
localContext
- the local context to use- Returns:
- this builder
-
context
@Deprecated(since="2021-07-05") public ExecutionInput.Builder context(java.lang.Object context)
Deprecated.- theExecutionInput.getGraphQLContext()
is a fixed mutable instance nowThe legacy context object- Parameters:
context
- the context object to use- Returns:
- this builder
-
graphQLContext
public ExecutionInput.Builder graphQLContext(java.util.function.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 input- Parameters:
builderFunction
- a builder function you can use to put values into the context- Returns:
- this builder
-
graphQLContext
public ExecutionInput.Builder graphQLContext(java.util.Map<?,java.lang.Object> mapOfContext)
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
-
root
public ExecutionInput.Builder root(java.lang.Object root)
-
variables
public ExecutionInput.Builder variables(java.util.Map<java.lang.String,java.lang.Object> rawVariables)
Adds raw (not coerced) variables- Parameters:
rawVariables
- the map of raw variables- Returns:
- this builder
-
extensions
public ExecutionInput.Builder extensions(java.util.Map<java.lang.String,java.lang.Object> 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
public ExecutionInput build()
-
-