Class ExecutionContext
java.lang.Object
graphql.execution.ExecutionContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CoercedVariablesprivate final Objectprivate final org.dataloader.DataLoaderRegistryprivate final Documentprivate final Set<ResultPath> private final AtomicReference<com.google.common.collect.ImmutableList<GraphQLError>> private final LockKit.ReentrantLockprivate final ExecutionIdprivate final ExecutionInputprivate final com.google.common.collect.ImmutableMap<String, FragmentDefinition> private final GraphQLContextprivate final GraphQLSchemaprivate final Instrumentationprivate final InstrumentationStateprivate final Objectprivate final Localeprivate final ExecutionStrategyprivate final OperationDefinitionprivate final ExecutionStrategyprivate final Supplier<ExecutableNormalizedOperation> private final ResultNodesInfoprivate final Objectprivate final ExecutionStrategyprivate final ValueUnboxer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(GraphQLError error) This method will allow you to add errors into the running execution context, without a check for per field unique-nessvoidaddError(GraphQLError error, ResultPath fieldPath) This method will only put one error per field path.voidaddErrors(List<GraphQLError> errors) This method will allow you to add errors into the running execution context, without a check for per field unique-ness<T> TDeprecated.org.dataloader.DataLoaderRegistrygetFragment(String name) <T> T<T> TgetRoot()getStrategy(OperationDefinition.Operation operation) Deprecated.usegetCoercedVariables()insteadtransform(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 Details
-
graphQLSchema
-
executionId
-
instrumentationState
-
queryStrategy
-
mutationStrategy
-
subscriptionStrategy
-
fragmentsByName
-
operationDefinition
-
document
-
coercedVariables
-
root
-
context
-
graphQLContext
-
localContext
-
instrumentation
-
errors
-
errorsLock
-
errorPaths
-
dataLoaderRegistry
private final org.dataloader.DataLoaderRegistry dataLoaderRegistry -
locale
-
valueUnboxer
-
executionInput
-
queryTree
-
resultNodesInfo
-
-
Constructor Details
-
ExecutionContext
ExecutionContext(ExecutionContextBuilder builder)
-
-
Method Details
-
getExecutionId
-
getExecutionInput
-
getInstrumentationState
-
getInstrumentation
-
getGraphQLSchema
-
getFragmentsByName
-
getDocument
-
getOperationDefinition
-
getVariables
Deprecated.usegetCoercedVariables()instead- Returns:
- map of coerced variables
-
getCoercedVariables
-
getContext
Deprecated.usegetGraphQLContext()instead- Type Parameters:
T- for two- Returns:
- the legacy context
-
getGraphQLContext
-
getLocalContext
public <T> T getLocalContext() -
getRoot
public <T> T getRoot() -
getFragment
-
getDataLoaderRegistry
public org.dataloader.DataLoaderRegistry getDataLoaderRegistry() -
getLocale
-
getValueUnboxer
-
addError
This method will only put one error per field path.- Parameters:
error- the error to addfieldPath- the field path to put it under
-
addError
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
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
- Returns:
- the total list of errors for this execution context
-
getQueryStrategy
-
getMutationStrategy
-
getSubscriptionStrategy
-
getStrategy
-
getNormalizedQueryTree
-
transform
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
-
getGraphQLContext()instead