@PublicSpi public interface WiringFactory
TypeResolver
s and DataFetcher
s
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)
Returns a
SchemaDirectiveWiring given the 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)
This is called to ask if this factory can provide a schema directive wiring.
|
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 environmentGraphQLScalarType
default boolean providesTypeResolver(InterfaceWiringEnvironment environment)
environment
- the wiring environmentdefault TypeResolver getTypeResolver(InterfaceWiringEnvironment environment)
TypeResolver
given the type interfaceenvironment
- the wiring environmentTypeResolver
default boolean providesTypeResolver(UnionWiringEnvironment environment)
environment
- the wiring environmentdefault TypeResolver getTypeResolver(UnionWiringEnvironment environment)
TypeResolver
given the type unionenvironment
- the union wiring environmentTypeResolver
default 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 environmentDataFetcherFactory
default boolean providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment)
SchemaDirectiveWiringEnvironment.getDirectives()
contains all the directives
available which may in fact be an empty list.
environment
- the calling environmentdefault SchemaDirectiveWiring getSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment)
SchemaDirectiveWiring
given the environmentenvironment
- the calling environmentSchemaDirectiveWiring
default boolean providesDataFetcher(FieldWiringEnvironment environment)
environment
- the wiring environmentdefault DataFetcher getDataFetcher(FieldWiringEnvironment environment)
DataFetcher
given the type definitionenvironment
- the wiring environmentDataFetcher
default DataFetcher getDefaultDataFetcher(FieldWiringEnvironment environment)
environment
- the wiring environmentDataFetcher