Class ExecutionContext

java.lang.Object
graphql.execution.ExecutionContext

@PublicApi public class ExecutionContext extends Object
  • Method Details

    • getExecutionId

      public ExecutionId getExecutionId()
    • getExecutionInput

      public ExecutionInput getExecutionInput()
    • getInstrumentationState

      public InstrumentationState getInstrumentationState()
    • getInstrumentation

      public Instrumentation getInstrumentation()
    • getGraphQLSchema

      public GraphQLSchema getGraphQLSchema()
    • getFragmentsByName

      public Map<String,FragmentDefinition> getFragmentsByName()
    • getDocument

      public Document getDocument()
    • getOperationDefinition

      public OperationDefinition getOperationDefinition()
    • getCoercedVariables

      public CoercedVariables getCoercedVariables()
    • getNormalizedVariables

      public Supplier<NormalizedVariables> getNormalizedVariables()
      Returns:
      a supplier that will give out the operations variables in normalized form
    • getContext

      @Deprecated(since="2021-07-05") public <T> T getContext()
      Deprecated.
      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(String name)
    • getDataLoaderRegistry

      public org.dataloader.DataLoaderRegistry getDataLoaderRegistry()
    • getLocale

      public Locale getLocale()
    • getValueUnboxer

      public ValueUnboxer getValueUnboxer()
    • propagateErrorsOnNonNullContractFailure

      @ExperimentalApi public boolean propagateErrorsOnNonNullContractFailure()
      Returns:
      true if the current operation should propagate errors in non-null positions Propagating errors is the default. Error aware clients may opt in returning null in non-null positions by using the `@experimental_disableErrorPropagation` directive.
      See Also:
    • isQueryOperation

      public boolean isQueryOperation()
      Returns:
      true if the current operation is a Query
    • isMutationOperation

      public boolean isMutationOperation()
      Returns:
      true if the current operation is a Mutation
    • isSubscriptionOperation

      public boolean isSubscriptionOperation()
      Returns:
      true if the current operation is a Subscription
    • addError

      public void addError(GraphQLError error, ResultPath fieldPath)
      This method will only put one error per field path.
      Parameters:
      error - the error to add
      fieldPath - 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(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
    • getResponseMapFactory

      public ResponseMapFactory getResponseMapFactory()
    • getErrors

      public 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()
    • getIncrementalCallState

      public IncrementalCallState getIncrementalCallState()
    • getStrategy

      public ExecutionStrategy getStrategy(OperationDefinition.Operation operation)
    • getNormalizedQueryTree

      public Supplier<ExecutableNormalizedOperation> getNormalizedQueryTree()
    • setDataLoaderDispatcherStrategy

      public void setDataLoaderDispatcherStrategy(DataLoaderDispatchStrategy dataLoaderDispatcherStrategy)
    • getDataLoaderDispatcherStrategy

      public DataLoaderDispatchStrategy getDataLoaderDispatcherStrategy()
    • transform

      public ExecutionContext transform(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()
    • hasIncrementalSupport

      public boolean hasIncrementalSupport()
    • getEngineRunningState

      public EngineRunningState getEngineRunningState()