Package graphql.schema.idl
Interface WiringFactory
- All Known Implementing Classes:
CombinedWiringFactory,EchoingWiringFactory,MockedWiringFactory,NoopWiringFactory
A WiringFactory allows you to more dynamically wire in
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.-
Method Summary
Modifier and TypeMethodDescriptiondefault DataFetchergetDataFetcher(FieldWiringEnvironment environment) Returns aDataFetchergiven the type definitiondefault <T> DataFetcherFactory<T> getDataFetcherFactory(FieldWiringEnvironment environment) Returns aDataFetcherFactorygiven the type definitiondefault DataFetchergetDefaultDataFetcher(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 provideddefault GraphQLScalarTypegetScalar(ScalarWiringEnvironment environment) Returns aGraphQLScalarTypegiven scalar defined in IDLdefault SchemaDirectiveWiringgetSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment) Returns aSchemaDirectiveWiringgiven the environmentdefault TypeResolvergetTypeResolver(InterfaceWiringEnvironment environment) Returns aTypeResolvergiven the type interfacedefault TypeResolvergetTypeResolver(UnionWiringEnvironment environment) Returns aTypeResolvergiven the type uniondefault booleanprovidesDataFetcher(FieldWiringEnvironment environment) This is called to ask if this factory can provide a data fetcher for the definitiondefault booleanprovidesDataFetcherFactory(FieldWiringEnvironment environment) This is called to ask if this factory can provide aDataFetcherFactoryfor the definitiondefault booleanprovidesScalar(ScalarWiringEnvironment environment) This is called to ask if this factory can provide a custom scalardefault booleanThis is called to ask if this factory can provide a schema directive wiring.default booleanprovidesTypeResolver(InterfaceWiringEnvironment environment) This is called to ask if this factory can provide a type resolver for the interfacedefault booleanprovidesTypeResolver(UnionWiringEnvironment environment) This is called to ask if this factory can provide a type resolver for the union
-
Method Details
-
providesScalar
This is called to ask if this factory can provide a custom scalar- Parameters:
environment- the wiring environment- Returns:
- true if the factory can give out a type resolver
-
getScalar
Returns aGraphQLScalarTypegiven scalar defined in IDL- Parameters:
environment- the wiring environment- Returns:
- a
GraphQLScalarType
-
providesTypeResolver
This is called to ask if this factory can provide a type resolver for the interface- Parameters:
environment- the wiring environment- Returns:
- true if the factory can give out a type resolver
-
getTypeResolver
Returns aTypeResolvergiven the type interface- Parameters:
environment- the wiring environment- Returns:
- a
TypeResolver
-
providesTypeResolver
This is called to ask if this factory can provide a type resolver for the union- Parameters:
environment- the wiring environment- Returns:
- true if the factory can give out a type resolver
-
getTypeResolver
Returns aTypeResolvergiven the type union- Parameters:
environment- the union wiring environment- Returns:
- a
TypeResolver
-
providesDataFetcherFactory
This is called to ask if this factory can provide aDataFetcherFactoryfor the definition- Parameters:
environment- the wiring environment- Returns:
- true if the factory can give out a data fetcher factory
-
getDataFetcherFactory
Returns aDataFetcherFactorygiven the type definition- Type Parameters:
T- the type of the data fetcher- Parameters:
environment- the wiring environment- Returns:
- a
DataFetcherFactory
-
providesSchemaDirectiveWiring
This is called to ask if this factory can provide a schema directive wiring.SchemaDirectiveWiringEnvironment.getDirectives()contains all the directives available which may in fact be an empty list.- Parameters:
environment- the calling environment- Returns:
- true if the factory can give out a schema directive wiring.
-
getSchemaDirectiveWiring
default SchemaDirectiveWiring getSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment) Returns aSchemaDirectiveWiringgiven the environment- Parameters:
environment- the calling environment- Returns:
- a
SchemaDirectiveWiring
-
providesDataFetcher
This is called to ask if this factory can provide a data fetcher for the definition- Parameters:
environment- the wiring environment- Returns:
- true if the factory can give out a data fetcher
-
getDataFetcher
Returns aDataFetchergiven the type definition- Parameters:
environment- the wiring environment- Returns:
- a
DataFetcher
-
getDefaultDataFetcher
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- Parameters:
environment- the wiring environment- Returns:
- a
DataFetcher
-