@PublicSpi public interface WiringFactory
TypeResolvers and DataFetchers
based on the IDL definitions. For example you could look at the directives say to build a more dynamic
set of type resolvers and data fetchers.| Modifier and Type | Method and Description |
|---|---|
default DataFetcher |
getDataFetcher(FieldWiringEnvironment environment)
Returns a
DataFetcher given the type definition |
default <T> DataFetcherFactory<T> |
getDataFetcherFactory(FieldWiringEnvironment environment)
Returns a
DataFetcherFactory given the type definition |
default DataFetcher |
getDefaultDataFetcher(FieldWiringEnvironment environment)
All fields need a data fetcher of some sort and this method is called to provide the data fetcher
that will be used if no specific one has been provided
|
default GraphQLScalarType |
getScalar(ScalarWiringEnvironment environment)
Returns a
GraphQLScalarType given scalar defined in IDL |
default SchemaDirectiveWiring |
getSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment) |
default TypeResolver |
getTypeResolver(InterfaceWiringEnvironment environment)
Returns a
TypeResolver given the type interface |
default TypeResolver |
getTypeResolver(UnionWiringEnvironment environment)
Returns a
TypeResolver given the type union |
default boolean |
providesDataFetcher(FieldWiringEnvironment environment)
This is called to ask if this factory can provide a data fetcher for the definition
|
default boolean |
providesDataFetcherFactory(FieldWiringEnvironment environment)
This is called to ask if this factory can provide a
DataFetcherFactory for the definition |
default boolean |
providesScalar(ScalarWiringEnvironment environment)
This is called to ask if this factory can provide a custom scalar
|
default boolean |
providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment) |
default boolean |
providesTypeResolver(InterfaceWiringEnvironment environment)
This is called to ask if this factory can provide a type resolver for the interface
|
default boolean |
providesTypeResolver(UnionWiringEnvironment environment)
This is called to ask if this factory can provide a type resolver for the union
|
default boolean providesScalar(ScalarWiringEnvironment environment)
environment - the wiring environmentdefault GraphQLScalarType getScalar(ScalarWiringEnvironment environment)
GraphQLScalarType given scalar defined in IDLenvironment - the wiring environmentGraphQLScalarTypedefault boolean providesTypeResolver(InterfaceWiringEnvironment environment)
environment - the wiring environmentdefault TypeResolver getTypeResolver(InterfaceWiringEnvironment environment)
TypeResolver given the type interfaceenvironment - the wiring environmentTypeResolverdefault boolean providesTypeResolver(UnionWiringEnvironment environment)
environment - the wiring environmentdefault TypeResolver getTypeResolver(UnionWiringEnvironment environment)
TypeResolver given the type unionenvironment - the union wiring environmentTypeResolverdefault boolean providesDataFetcherFactory(FieldWiringEnvironment environment)
DataFetcherFactory for the definitionenvironment - the wiring environmentdefault <T> DataFetcherFactory<T> getDataFetcherFactory(FieldWiringEnvironment environment)
DataFetcherFactory given the type definitionT - the type of the data fetcherenvironment - the wiring environmentDataFetcherFactorydefault boolean providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment)
default SchemaDirectiveWiring getSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment)
default boolean providesDataFetcher(FieldWiringEnvironment environment)
environment - the wiring environmentdefault DataFetcher getDataFetcher(FieldWiringEnvironment environment)
DataFetcher given the type definitionenvironment - the wiring environmentDataFetcherdefault DataFetcher getDefaultDataFetcher(FieldWiringEnvironment environment)
environment - the wiring environmentDataFetcher