Package graphql.schema.idl
Class CombinedWiringFactory
- java.lang.Object
-
- graphql.schema.idl.CombinedWiringFactory
-
- All Implemented Interfaces:
WiringFactory
@PublicApi public class CombinedWiringFactory extends java.lang.Object implements WiringFactory
This combines a number ofWiringFactory
s together to act as one. It asks each one whether it handles a type and delegates to the first one to answer yes.
-
-
Constructor Summary
Constructors Constructor Description CombinedWiringFactory(java.util.List<WiringFactory> factories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataFetcher
getDataFetcher(FieldWiringEnvironment environment)
Returns aDataFetcher
given the type definition<T> DataFetcherFactory<T>
getDataFetcherFactory(FieldWiringEnvironment environment)
Returns aDataFetcherFactory
given the type definitionDataFetcher
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 providedGraphQLScalarType
getScalar(ScalarWiringEnvironment environment)
Returns aGraphQLScalarType
given scalar defined in IDLSchemaDirectiveWiring
getSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment)
Returns aSchemaDirectiveWiring
given the environmentTypeResolver
getTypeResolver(InterfaceWiringEnvironment environment)
Returns aTypeResolver
given the type interfaceTypeResolver
getTypeResolver(UnionWiringEnvironment environment)
Returns aTypeResolver
given the type unionboolean
providesDataFetcher(FieldWiringEnvironment environment)
This is called to ask if this factory can provide a data fetcher for the definitionboolean
providesDataFetcherFactory(FieldWiringEnvironment environment)
This is called to ask if this factory can provide aDataFetcherFactory
for the definitionboolean
providesScalar(ScalarWiringEnvironment environment)
This is called to ask if this factory can provide a custom scalarboolean
providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment)
This is called to ask if this factory can provide a schema directive wiring.boolean
providesTypeResolver(InterfaceWiringEnvironment environment)
This is called to ask if this factory can provide a type resolver for the interfaceboolean
providesTypeResolver(UnionWiringEnvironment environment)
This is called to ask if this factory can provide a type resolver for the union
-
-
-
Constructor Detail
-
CombinedWiringFactory
public CombinedWiringFactory(java.util.List<WiringFactory> factories)
-
-
Method Detail
-
providesTypeResolver
public boolean providesTypeResolver(InterfaceWiringEnvironment environment)
Description copied from interface:WiringFactory
This is called to ask if this factory can provide a type resolver for the interface- Specified by:
providesTypeResolver
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- true if the factory can give out a type resolver
-
getTypeResolver
public TypeResolver getTypeResolver(InterfaceWiringEnvironment environment)
Description copied from interface:WiringFactory
Returns aTypeResolver
given the type interface- Specified by:
getTypeResolver
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- a
TypeResolver
-
providesTypeResolver
public boolean providesTypeResolver(UnionWiringEnvironment environment)
Description copied from interface:WiringFactory
This is called to ask if this factory can provide a type resolver for the union- Specified by:
providesTypeResolver
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- true if the factory can give out a type resolver
-
getTypeResolver
public TypeResolver getTypeResolver(UnionWiringEnvironment environment)
Description copied from interface:WiringFactory
Returns aTypeResolver
given the type union- Specified by:
getTypeResolver
in interfaceWiringFactory
- Parameters:
environment
- the union wiring environment- Returns:
- a
TypeResolver
-
providesDataFetcherFactory
public boolean providesDataFetcherFactory(FieldWiringEnvironment environment)
Description copied from interface:WiringFactory
This is called to ask if this factory can provide aDataFetcherFactory
for the definition- Specified by:
providesDataFetcherFactory
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- true if the factory can give out a data fetcher factory
-
getDataFetcherFactory
public <T> DataFetcherFactory<T> getDataFetcherFactory(FieldWiringEnvironment environment)
Description copied from interface:WiringFactory
Returns aDataFetcherFactory
given the type definition- Specified by:
getDataFetcherFactory
in interfaceWiringFactory
- Type Parameters:
T
- the type of the data fetcher- Parameters:
environment
- the wiring environment- Returns:
- a
DataFetcherFactory
-
providesDataFetcher
public boolean providesDataFetcher(FieldWiringEnvironment environment)
Description copied from interface:WiringFactory
This is called to ask if this factory can provide a data fetcher for the definition- Specified by:
providesDataFetcher
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- true if the factory can give out a data fetcher
-
getDataFetcher
public DataFetcher getDataFetcher(FieldWiringEnvironment environment)
Description copied from interface:WiringFactory
Returns aDataFetcher
given the type definition- Specified by:
getDataFetcher
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- a
DataFetcher
-
providesScalar
public boolean providesScalar(ScalarWiringEnvironment environment)
Description copied from interface:WiringFactory
This is called to ask if this factory can provide a custom scalar- Specified by:
providesScalar
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- true if the factory can give out a type resolver
-
getScalar
public GraphQLScalarType getScalar(ScalarWiringEnvironment environment)
Description copied from interface:WiringFactory
Returns aGraphQLScalarType
given scalar defined in IDL- Specified by:
getScalar
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- a
GraphQLScalarType
-
providesSchemaDirectiveWiring
public boolean providesSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment)
Description copied from interface:WiringFactory
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.- Specified by:
providesSchemaDirectiveWiring
in interfaceWiringFactory
- Parameters:
environment
- the calling environment- Returns:
- true if the factory can give out a schema directive wiring.
-
getSchemaDirectiveWiring
public SchemaDirectiveWiring getSchemaDirectiveWiring(SchemaDirectiveWiringEnvironment environment)
Description copied from interface:WiringFactory
Returns aSchemaDirectiveWiring
given the environment- Specified by:
getSchemaDirectiveWiring
in interfaceWiringFactory
- Parameters:
environment
- the calling environment- Returns:
- a
SchemaDirectiveWiring
-
getDefaultDataFetcher
public DataFetcher getDefaultDataFetcher(FieldWiringEnvironment environment)
Description copied from interface:WiringFactory
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- Specified by:
getDefaultDataFetcher
in interfaceWiringFactory
- Parameters:
environment
- the wiring environment- Returns:
- a
DataFetcher
-
-