Package graphql
Class ExecutionInput
java.lang.Object
graphql.ExecutionInput
This represents the series of values that can be input on a graphql query execution
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()This can be called to cancel the graphql execution.Deprecated.org.dataloader.DataLoaderRegistryThis returns the locale of this operation.getQuery()getRoot()booleanThe graphql engine will check this frequently and if that is true, it will throw aAbortExecutionExceptionto cancel the execution.static ExecutionInput.Builderstatic ExecutionInput.BuildernewExecutionInput(String query) Creates a new builder of ExecutionInput objects with the given querytoString()transform(Consumer<ExecutionInput.Builder> builderConsumer) This helps you transform the current ExecutionInput object into another one by starting a builder with all the current values and allows you to transform it how you want.
-
Method Details
-
getQuery
- Returns:
- the query text
-
getOperationName
- Returns:
- the name of the query operation
-
getContext
Deprecated.- usegetGraphQLContext()The legacy context object has been deprecated in favour of the more shareablegetGraphQLContext()- Returns:
- the context object to pass to all data fetchers
-
getGraphQLContext
- Returns:
- the shared
GraphQLContextobject to pass to all data fetchers
-
getLocalContext
- Returns:
- the local context object to pass to all top level (i.e. query, mutation, subscription) data fetchers
-
getRoot
- Returns:
- the root object to start the query execution on
-
getVariables
- Returns:
- a map of raw variables that can be referenced via $syntax in the query.
-
getRawVariables
- Returns:
- a map of raw variables that can be referenced via $syntax in the query.
-
getDataLoaderRegistry
public org.dataloader.DataLoaderRegistry getDataLoaderRegistry()- Returns:
- the data loader registry associated with this execution
-
getExecutionId
- Returns:
- Id that will be/was used to execute this operation.
-
getLocale
This returns the locale of this operation.- Returns:
- the locale of this operation
-
getExtensions
- Returns:
- a map of extension values that can be sent in to a request
-
isCancelled
public boolean isCancelled()The graphql engine will check this frequently and if that is true, it will throw aAbortExecutionExceptionto cancel the execution.This is a cooperative cancellation. Some asynchronous data fetching code may still continue to run but there will be no more efforts run future field fetches say.
- Returns:
- true if the execution should be cancelled
-
cancel
public void cancel()This can be called to cancel the graphql execution. Remember this is a cooperative cancellation and the graphql engine needs to be running on a thread to allow is to respect this flag. -
transform
This helps you transform the current ExecutionInput 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 ExecutionInput object based on calling build on that builder
-
toString
-
newExecutionInput
- Returns:
- a new builder of ExecutionInput objects
-
newExecutionInput
Creates a new builder of ExecutionInput objects with the given query- Parameters:
query- the query to execute- Returns:
- a new builder of ExecutionInput objects
-
getGraphQLContext()