public class DataFetchingEnvironmentImpl extends java.lang.Object implements DataFetchingEnvironment
Constructor and Description |
---|
DataFetchingEnvironmentImpl(java.lang.Object source,
java.util.Map<java.lang.String,java.lang.Object> arguments,
java.lang.Object context,
java.lang.Object root,
GraphQLFieldDefinition fieldDefinition,
java.util.List<Field> fields,
GraphQLOutputType fieldType,
GraphQLType parentType,
GraphQLSchema graphQLSchema,
java.util.Map<java.lang.String,FragmentDefinition> fragmentsByName,
ExecutionId executionId,
DataFetchingFieldSelectionSet selectionSet,
ExecutionTypeInfo fieldTypeInfo,
ExecutionContext executionContext) |
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. |
ExecutionContext |
getExecutionContext() |
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.
|
java.lang.String |
toString() |
public DataFetchingEnvironmentImpl(java.lang.Object source, java.util.Map<java.lang.String,java.lang.Object> arguments, java.lang.Object context, java.lang.Object root, GraphQLFieldDefinition fieldDefinition, java.util.List<Field> fields, GraphQLOutputType fieldType, GraphQLType parentType, GraphQLSchema graphQLSchema, java.util.Map<java.lang.String,FragmentDefinition> fragmentsByName, ExecutionId executionId, DataFetchingFieldSelectionSet selectionSet, ExecutionTypeInfo fieldTypeInfo, ExecutionContext executionContext)
public <T> T getSource()
DataFetchingEnvironment
For the root query, it is equal to {DataFetchingEnvironment.getRoot()
getSource
in interface DataFetchingEnvironment
T
- you decide what type it ispublic java.util.Map<java.lang.String,java.lang.Object> getArguments()
getArguments
in interface DataFetchingEnvironment
public boolean containsArgument(java.lang.String name)
DataFetchingEnvironment
containsArgument
in interface DataFetchingEnvironment
name
- the name of the argumentpublic <T> T getArgument(java.lang.String name)
DataFetchingEnvironment
getArgument
in interface DataFetchingEnvironment
T
- you decide what type it isname
- the name of the argumentpublic <T> T getContext()
DataFetchingEnvironment
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.
getContext
in interface DataFetchingEnvironment
T
- you decide what type it ispublic <T> T getRoot()
DataFetchingEnvironment
getRoot
in interface DataFetchingEnvironment
T
- you decide what type it ispublic GraphQLFieldDefinition getFieldDefinition()
getFieldDefinition
in interface DataFetchingEnvironment
public java.util.List<Field> getFields()
DataFetchingEnvironment
DataFetchingEnvironment.getField()
.
Example query with more than one Field returned:
query Foo {
bar
...BarFragment
}
fragment BarFragment on Query {
bar
}getFields
in interface DataFetchingEnvironment
public Field getField()
getField
in interface DataFetchingEnvironment
DataFetchingEnvironment.getFields()
public GraphQLOutputType getFieldType()
getFieldType
in interface DataFetchingEnvironment
public GraphQLType getParentType()
getParentType
in interface DataFetchingEnvironment
public GraphQLSchema getGraphQLSchema()
getGraphQLSchema
in interface DataFetchingEnvironment
public java.util.Map<java.lang.String,FragmentDefinition> getFragmentsByName()
getFragmentsByName
in interface DataFetchingEnvironment
FragmentDefinition
map for the current data fetch operationpublic ExecutionId getExecutionId()
getExecutionId
in interface DataFetchingEnvironment
ExecutionId
for the current data fetch operationpublic DataFetchingFieldSelectionSet getSelectionSet()
getSelectionSet
in interface DataFetchingEnvironment
DataFetchingFieldSelectionSet
for the current data fetch operationpublic ExecutionTypeInfo getFieldTypeInfo()
getFieldTypeInfo
in interface DataFetchingEnvironment
ExecutionTypeInfo
for the current data fetch operationpublic ExecutionContext getExecutionContext()
getExecutionContext
in interface DataFetchingEnvironment
ExecutionContext
. It gives access to the overall schema and other things related to the overall execution of the current request.public java.lang.String toString()
toString
in class java.lang.Object