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
ADataFetcherthat 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.Objectget(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:DataFetcherThis is called by the graphql engine to fetch the value. TheDataFetchingEnvironmentis 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:
getin 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
-
-