Package graphql.schema
Class StaticDataFetcher
- java.lang.Object
-
- graphql.schema.StaticDataFetcher
-
- All Implemented Interfaces:
DataFetcher
,TrivialDataFetcher
@PublicApi public class StaticDataFetcher extends java.lang.Object implements DataFetcher, TrivialDataFetcher
ADataFetcher
that always returns the same value
-
-
Constructor Summary
Constructors Constructor Description StaticDataFetcher(java.lang.Object value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
get(DataFetchingEnvironment environment)
This is called by the graphql engine to fetch the value.
-
-
-
Method Detail
-
get
public java.lang.Object get(DataFetchingEnvironment environment)
Description copied from interface:DataFetcher
This is called by the graphql engine to fetch the value. TheDataFetchingEnvironment
is a composite context object that tells you all you need to know about how to fetch a data value in graphql type terms.- Specified by:
get
in interfaceDataFetcher
- Parameters:
environment
- this is the data fetching environment which contains all the context you need to fetch a value- Returns:
- a value of type T. May be wrapped in a
DataFetcherResult
-
-