Package graphql.schema
Interface DataFetcherFactory<T>
-
- Type Parameters:
T- the type of DataFetcher
@PublicSpi public interface DataFetcherFactory<T>
A DataFetcherFactory allows a level of indirection in providingDataFetchers for graphql fields. For example if you are using an IoC container such as Spring or Guice, you can use this indirection to give you per request late binding of a data fetcher with its dependencies injected in.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description DataFetcher<T>get(DataFetcherFactoryEnvironment environment)Deprecated.This method will go away at some point andget(GraphQLFieldDefinition)will be useddefault DataFetcher<T>get(GraphQLFieldDefinition fieldDefinition)Returns aDataFetchergiven the field definition which is cheaper in object allocation terms.
-
-
-
Method Detail
-
get
@Deprecated(since="2024-11-26") DataFetcher<T> get(DataFetcherFactoryEnvironment environment)
Deprecated.This method will go away at some point andget(GraphQLFieldDefinition)will be usedReturns aDataFetcher- Parameters:
environment- the environment that needs the data fetcher- Returns:
- a data fetcher
-
get
default DataFetcher<T> get(GraphQLFieldDefinition fieldDefinition)
Returns aDataFetchergiven the field definition which is cheaper in object allocation terms.- Parameters:
fieldDefinition- the field that needs the data fetcher- Returns:
- a data fetcher
-
-