Package graphql.schema.idl
Class MockedWiringFactory
java.lang.Object
graphql.schema.idl.MockedWiringFactory
- All Implemented Interfaces:
WiringFactory
This is a
WiringFactory
which provides mocked types resolver
and scalars. It is useful for testing only, for example for creating schemas
that can be inspected but not executed on.
See RuntimeWiring.MOCKED_WIRING
for example usage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDataFetcher
<?> getDataFetcher
(FieldWiringEnvironment environment) Returns aDataFetcher
given the type definitiongetScalar
(ScalarWiringEnvironment environment) Returns aGraphQLScalarType
given scalar defined in IDLgetTypeResolver
(InterfaceWiringEnvironment environment) Returns aTypeResolver
given the type interfacegetTypeResolver
(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
providesScalar
(ScalarWiringEnvironment environment) This is called to ask if this factory can provide a custom scalarboolean
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 unionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface graphql.schema.idl.WiringFactory
getDataFetcherFactory, getDefaultDataFetcher, getSchemaDirectiveWiring, providesDataFetcherFactory, providesSchemaDirectiveWiring
-
Constructor Details
-
MockedWiringFactory
public MockedWiringFactory()
-
-
Method Details
-
providesTypeResolver
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
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
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
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
-
providesDataFetcher
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
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
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
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
-