@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 inputModifier 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. |
ExecutionId |
getExecutionId() |
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() |
ExecutionTypeInfo |
getFieldTypeInfo() |
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()
ExecutionTypeInfo getFieldTypeInfo()
ExecutionTypeInfo
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 operation