Package graphql
Class ExecutionInput
- java.lang.Object
-
- graphql.ExecutionInput
-
@PublicApi public class ExecutionInput extends java.lang.Object
This represents the series of values that can be input on a graphql query execution
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExecutionInput.Builder
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
context
private org.dataloader.DataLoaderRegistry
dataLoaderRegistry
private ExecutionId
executionId
private java.util.Map<java.lang.String,java.lang.Object>
extensions
private GraphQLContext
graphQLContext
private java.lang.Object
localContext
private java.util.Locale
locale
private java.lang.String
operationName
private java.lang.String
query
private RawVariables
rawVariables
private java.lang.Object
root
-
Constructor Summary
Constructors Modifier Constructor Description private
ExecutionInput(ExecutionInput.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
getContext()
Deprecated.- usegetGraphQLContext()
org.dataloader.DataLoaderRegistry
getDataLoaderRegistry()
ExecutionId
getExecutionId()
java.util.Map<java.lang.String,java.lang.Object>
getExtensions()
GraphQLContext
getGraphQLContext()
java.lang.Object
getLocalContext()
java.util.Locale
getLocale()
This returns the locale of this operation.java.lang.String
getOperationName()
java.lang.String
getQuery()
RawVariables
getRawVariables()
java.lang.Object
getRoot()
java.util.Map<java.lang.String,java.lang.Object>
getVariables()
static ExecutionInput.Builder
newExecutionInput()
static ExecutionInput.Builder
newExecutionInput(java.lang.String query)
Creates a new builder of ExecutionInput objects with the given queryjava.lang.String
toString()
ExecutionInput
transform(java.util.function.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.
-
-
-
Field Detail
-
query
private final java.lang.String query
-
operationName
private final java.lang.String operationName
-
context
private final java.lang.Object context
-
graphQLContext
private final GraphQLContext graphQLContext
-
localContext
private final java.lang.Object localContext
-
root
private final java.lang.Object root
-
rawVariables
private final RawVariables rawVariables
-
extensions
private final java.util.Map<java.lang.String,java.lang.Object> extensions
-
dataLoaderRegistry
private final org.dataloader.DataLoaderRegistry dataLoaderRegistry
-
executionId
private final ExecutionId executionId
-
locale
private final java.util.Locale locale
-
-
Constructor Detail
-
ExecutionInput
private ExecutionInput(ExecutionInput.Builder builder)
-
-
Method Detail
-
getQuery
public java.lang.String getQuery()
- Returns:
- the query text
-
getOperationName
public java.lang.String getOperationName()
- Returns:
- the name of the query operation
-
getContext
@Deprecated public java.lang.Object 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
public GraphQLContext getGraphQLContext()
- Returns:
- the shared
GraphQLContext
object to pass to all data fetchers
-
getLocalContext
public java.lang.Object getLocalContext()
- Returns:
- the local context object to pass to all top level (i.e. query, mutation, subscription) data fetchers
-
getRoot
public java.lang.Object getRoot()
- Returns:
- the root object to start the query execution on
-
getVariables
public java.util.Map<java.lang.String,java.lang.Object> getVariables()
- Returns:
- a map of raw variables that can be referenced via $syntax in the query.
-
getRawVariables
public RawVariables 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
public ExecutionId getExecutionId()
- Returns:
- Id that will be/was used to execute this operation.
-
getLocale
public java.util.Locale getLocale()
This returns the locale of this operation.- Returns:
- the locale of this operation
-
getExtensions
public java.util.Map<java.lang.String,java.lang.Object> getExtensions()
- Returns:
- a map of extension values that can be sent in to a request
-
transform
public ExecutionInput transform(java.util.function.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.- 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newExecutionInput
public static ExecutionInput.Builder newExecutionInput()
- Returns:
- a new builder of ExecutionInput objects
-
newExecutionInput
public static ExecutionInput.Builder newExecutionInput(java.lang.String query)
Creates a new builder of ExecutionInput objects with the given query- Parameters:
query
- the query to execute- Returns:
- a new builder of ExecutionInput objects
-
-