@PublicApi public interface DataFetchingEnvironment
DataFetcher as a execution context and its
the place where you can find out information to help you resolve a data value given a graphql field input| Modifier and Type | Method and Description |
|---|---|
boolean |
containsArgument(java.lang.String name)
Returns true of the named argument is present
|
<T> T |
getArgument(java.lang.String name)
Returns the named argument
|
java.util.Map<java.lang.String,java.lang.Object> |
getArguments() |
<T> T |
getContext()
Returns a context argument that is set up when the
GraphQL.execute(java.lang.String) method
is invoked. |
<K,V> org.dataloader.DataLoader<K,V> |
getDataLoader(java.lang.String dataLoaderName)
This allows you to retrieve a named dataloader from the underlying
DataLoaderRegistry |
ExecutionContext |
getExecutionContext() |
ExecutionId |
getExecutionId() |
ExecutionStepInfo |
getExecutionStepInfo() |
Field |
getField() |
GraphQLFieldDefinition |
getFieldDefinition() |
java.util.List<Field> |
getFields()
It can happen that a query has overlapping fields which are
are querying the same data.
|
GraphQLOutputType |
getFieldType() |
java.util.Map<java.lang.String,FragmentDefinition> |
getFragmentsByName() |
GraphQLSchema |
getGraphQLSchema() |
GraphQLType |
getParentType() |
<T> T |
getRoot()
This is the source object for the root query.
|
DataFetchingFieldSelectionSet |
getSelectionSet() |
<T> T |
getSource()
This is the value of the current object to be queried.
|
<T> T getSource()
For the root query, it is equal to {getRoot()
T - you decide what type it isjava.util.Map<java.lang.String,java.lang.Object> getArguments()
boolean containsArgument(java.lang.String name)
name - the name of the argument<T> T getArgument(java.lang.String name)
T - you decide what type it isname - the name of the argument<T> T getContext()
GraphQL.execute(java.lang.String) method
is invoked.
This is a info object which is provided to all DataFetcher, but never used by graphql-java itself.
T - you decide what type it is<T> T getRoot()
T - you decide what type it isGraphQLFieldDefinition getFieldDefinition()
java.util.List<Field> getFields()
getField().
Example query with more than one Field returned:
query Foo {
bar
...BarFragment
}
fragment BarFragment on Query {
bar
}
Field getField()
getFields()GraphQLOutputType getFieldType()
ExecutionStepInfo getExecutionStepInfo()
ExecutionStepInfo for the current data fetch operationGraphQLType getParentType()
GraphQLSchema getGraphQLSchema()
java.util.Map<java.lang.String,FragmentDefinition> getFragmentsByName()
FragmentDefinition map for the current data fetch operationExecutionId getExecutionId()
ExecutionId for the current data fetch operationDataFetchingFieldSelectionSet getSelectionSet()
DataFetchingFieldSelectionSet for the current data fetch operationExecutionContext getExecutionContext()
ExecutionContext. It gives access to the overall schema and other things related to the overall execution of the current request.<K,V> org.dataloader.DataLoader<K,V> getDataLoader(java.lang.String dataLoaderName)
DataLoaderRegistryK - the key typeV - the value typedataLoaderName - the name of the data loader to fetchExecutionContext.getDataLoaderRegistry(),
DataLoaderRegistry.getDataLoader(String)