Package graphql.schema.idl
Interface WiringFactory
- All Known Implementing Classes:
CombinedWiringFactory
,EchoingWiringFactory
,MockedWiringFactory
,NoopWiringFactory
A WiringFactory allows you to more dynamically wire in
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.-
Method Summary
Modifier and TypeMethodDescriptiondefault DataFetcher
getDataFetcher
(FieldWiringEnvironment environment) Returns aDataFetcher
given the type definitiondefault <T> DataFetcherFactory
<T> getDataFetcherFactory
(FieldWiringEnvironment environment) Returns aDataFetcherFactory
given the type definitiondefault 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 provideddefault GraphQLScalarType
getScalar
(ScalarWiringEnvironment environment) Returns aGraphQLScalarType
given scalar defined in IDLdefault SchemaDirectiveWiring
getSchemaDirectiveWiring
(SchemaDirectiveWiringEnvironment environment) Returns aSchemaDirectiveWiring
given the environmentdefault TypeResolver
getTypeResolver
(InterfaceWiringEnvironment environment) Returns aTypeResolver
given the type interfacedefault TypeResolver
getTypeResolver
(UnionWiringEnvironment environment) Returns aTypeResolver
given the type uniondefault boolean
providesDataFetcher
(FieldWiringEnvironment environment) This is called to ask if this factory can provide a data fetcher for the definitiondefault boolean
providesDataFetcherFactory
(FieldWiringEnvironment environment) This is called to ask if this factory can provide aDataFetcherFactory
for the definitiondefault boolean
providesScalar
(ScalarWiringEnvironment environment) This is called to ask if this factory can provide a custom scalardefault boolean
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 interfacedefault boolean
providesTypeResolver
(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 aGraphQLScalarType
given 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 aTypeResolver
given 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 aTypeResolver
given the type union- Parameters:
environment
- the union wiring environment- Returns:
- a
TypeResolver
-
providesDataFetcherFactory
This is called to ask if this factory can provide aDataFetcherFactory
for the definition- Parameters:
environment
- the wiring environment- Returns:
- true if the factory can give out a data fetcher factory
-
getDataFetcherFactory
Returns aDataFetcherFactory
given 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 aSchemaDirectiveWiring
given 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 aDataFetcher
given 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
-