Package graphql.execution
Class ExecutionContext
- java.lang.Object
-
- graphql.execution.ExecutionContext
-
@PublicApi public class ExecutionContext extends java.lang.Object
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ExecutionContext(ExecutionContextBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addError(GraphQLError error)
This method will allow you to add errors into the running execution context, without a check for per field unique-nessvoid
addError(GraphQLError error, ResultPath fieldPath)
This method will only put one error per field path.void
addErrors(java.util.List<GraphQLError> errors)
This method will allow you to add errors into the running execution context, without a check for per field unique-nessCoercedVariables
getCoercedVariables()
<T> T
getContext()
Deprecated.usegetGraphQLContext()
insteadorg.dataloader.DataLoaderRegistry
getDataLoaderRegistry()
Document
getDocument()
java.util.List<GraphQLError>
getErrors()
ExecutionId
getExecutionId()
ExecutionInput
getExecutionInput()
FragmentDefinition
getFragment(java.lang.String name)
java.util.Map<java.lang.String,FragmentDefinition>
getFragmentsByName()
GraphQLContext
getGraphQLContext()
GraphQLSchema
getGraphQLSchema()
Instrumentation
getInstrumentation()
InstrumentationState
getInstrumentationState()
<T> T
getLocalContext()
java.util.Locale
getLocale()
ExecutionStrategy
getMutationStrategy()
java.util.function.Supplier<ExecutableNormalizedOperation>
getNormalizedQueryTree()
OperationDefinition
getOperationDefinition()
ExecutionStrategy
getQueryStrategy()
ResultNodesInfo
getResultNodesInfo()
<T> T
getRoot()
ExecutionStrategy
getStrategy(OperationDefinition.Operation operation)
ExecutionStrategy
getSubscriptionStrategy()
ValueUnboxer
getValueUnboxer()
java.util.Map<java.lang.String,java.lang.Object>
getVariables()
Deprecated.usegetCoercedVariables()
insteadExecutionContext
transform(java.util.function.Consumer<ExecutionContextBuilder> builderConsumer)
This helps you transform the current ExecutionContext object into another one by starting a builder with all the current values and allows you to transform it how you want.
-
-
-
Field Detail
-
graphQLSchema
private final GraphQLSchema graphQLSchema
-
executionId
private final ExecutionId executionId
-
instrumentationState
private final InstrumentationState instrumentationState
-
queryStrategy
private final ExecutionStrategy queryStrategy
-
mutationStrategy
private final ExecutionStrategy mutationStrategy
-
subscriptionStrategy
private final ExecutionStrategy subscriptionStrategy
-
fragmentsByName
private final com.google.common.collect.ImmutableMap<java.lang.String,FragmentDefinition> fragmentsByName
-
operationDefinition
private final OperationDefinition operationDefinition
-
document
private final Document document
-
coercedVariables
private final CoercedVariables coercedVariables
-
root
private final java.lang.Object root
-
context
private final java.lang.Object context
-
graphQLContext
private final GraphQLContext graphQLContext
-
localContext
private final java.lang.Object localContext
-
instrumentation
private final Instrumentation instrumentation
-
errors
private final java.util.concurrent.atomic.AtomicReference<com.google.common.collect.ImmutableList<GraphQLError>> errors
-
errorsLock
private final LockKit.ReentrantLock errorsLock
-
errorPaths
private final java.util.Set<ResultPath> errorPaths
-
dataLoaderRegistry
private final org.dataloader.DataLoaderRegistry dataLoaderRegistry
-
locale
private final java.util.Locale locale
-
valueUnboxer
private final ValueUnboxer valueUnboxer
-
executionInput
private final ExecutionInput executionInput
-
queryTree
private final java.util.function.Supplier<ExecutableNormalizedOperation> queryTree
-
resultNodesInfo
private final ResultNodesInfo resultNodesInfo
-
-
Constructor Detail
-
ExecutionContext
ExecutionContext(ExecutionContextBuilder builder)
-
-
Method Detail
-
getExecutionId
public ExecutionId getExecutionId()
-
getExecutionInput
public ExecutionInput getExecutionInput()
-
getInstrumentationState
public InstrumentationState getInstrumentationState()
-
getInstrumentation
public Instrumentation getInstrumentation()
-
getGraphQLSchema
public GraphQLSchema getGraphQLSchema()
-
getFragmentsByName
public java.util.Map<java.lang.String,FragmentDefinition> getFragmentsByName()
-
getDocument
public Document getDocument()
-
getOperationDefinition
public OperationDefinition getOperationDefinition()
-
getVariables
@Deprecated public java.util.Map<java.lang.String,java.lang.Object> getVariables()
Deprecated.usegetCoercedVariables()
instead- Returns:
- map of coerced variables
-
getCoercedVariables
public CoercedVariables getCoercedVariables()
-
getContext
@Deprecated public <T> T getContext()
Deprecated.usegetGraphQLContext()
instead- Type Parameters:
T
- for two- Returns:
- the legacy context
-
getGraphQLContext
public GraphQLContext getGraphQLContext()
-
getLocalContext
public <T> T getLocalContext()
-
getRoot
public <T> T getRoot()
-
getFragment
public FragmentDefinition getFragment(java.lang.String name)
-
getDataLoaderRegistry
public org.dataloader.DataLoaderRegistry getDataLoaderRegistry()
-
getLocale
public java.util.Locale getLocale()
-
getValueUnboxer
public ValueUnboxer getValueUnboxer()
-
addError
public void addError(GraphQLError error, ResultPath fieldPath)
This method will only put one error per field path.- Parameters:
error
- the error to addfieldPath
- the field path to put it under
-
addError
public void addError(GraphQLError error)
This method will allow you to add errors into the running execution context, without a check for per field unique-ness- Parameters:
error
- the error to add
-
addErrors
public void addErrors(java.util.List<GraphQLError> errors)
This method will allow you to add errors into the running execution context, without a check for per field unique-ness- Parameters:
errors
- the errors to add
-
getErrors
public java.util.List<GraphQLError> getErrors()
- Returns:
- the total list of errors for this execution context
-
getQueryStrategy
public ExecutionStrategy getQueryStrategy()
-
getMutationStrategy
public ExecutionStrategy getMutationStrategy()
-
getSubscriptionStrategy
public ExecutionStrategy getSubscriptionStrategy()
-
getStrategy
public ExecutionStrategy getStrategy(OperationDefinition.Operation operation)
-
getNormalizedQueryTree
public java.util.function.Supplier<ExecutableNormalizedOperation> getNormalizedQueryTree()
-
transform
public ExecutionContext transform(java.util.function.Consumer<ExecutionContextBuilder> builderConsumer)
This helps you transform the current ExecutionContext object into another one by starting a builder with all the current values and allows you to transform it how you want.- Parameters:
builderConsumer
- the consumer code that will be given a builder to transform- Returns:
- a new ExecutionContext object based on calling build on that builder
-
getResultNodesInfo
public ResultNodesInfo getResultNodesInfo()
-
-