Package graphql.schema.idl
Class EchoingWiringFactory
java.lang.Object
graphql.schema.idl.EchoingWiringFactory
- All Implemented Interfaces:
WiringFactory
A wiring factory that will echo back the objects defined. That is if you have a field called
"name" of type String, it will echo back the value "name". This is ONLY useful for mocking out a
schema that do don't want to actually execute properly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GraphQLScalarTypefakeScalar(String name) 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 providedgetTypeResolver(InterfaceWiringEnvironment environment) Returns aTypeResolvergiven the type interfacegetTypeResolver(UnionWiringEnvironment environment) Returns aTypeResolvergiven the type unionstatic RuntimeWiringstatic RuntimeWiringnewEchoingWiring(Consumer<RuntimeWiring.Builder> builderConsumer) booleanprovidesTypeResolver(InterfaceWiringEnvironment environment) This is called to ask if this factory can provide a type resolver for the interfacebooleanprovidesTypeResolver(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, waitMethods inherited from interface graphql.schema.idl.WiringFactory
getDataFetcher, getDataFetcherFactory, getScalar, getSchemaDirectiveWiring, providesDataFetcher, providesDataFetcherFactory, providesScalar, providesSchemaDirectiveWiring
-
Constructor Details
-
EchoingWiringFactory
public EchoingWiringFactory()
-
-
Method Details
-
newEchoingWiring
-
newEchoingWiring
-
providesTypeResolver
Description copied from interface:WiringFactoryThis is called to ask if this factory can provide a type resolver for the interface- Specified by:
providesTypeResolverin interfaceWiringFactory- Parameters:
environment- the wiring environment- Returns:
- true if the factory can give out a type resolver
-
getTypeResolver
Description copied from interface:WiringFactoryReturns aTypeResolvergiven the type interface- Specified by:
getTypeResolverin interfaceWiringFactory- Parameters:
environment- the wiring environment- Returns:
- a
TypeResolver
-
providesTypeResolver
Description copied from interface:WiringFactoryThis is called to ask if this factory can provide a type resolver for the union- Specified by:
providesTypeResolverin interfaceWiringFactory- Parameters:
environment- the wiring environment- Returns:
- true if the factory can give out a type resolver
-
getTypeResolver
Description copied from interface:WiringFactoryReturns aTypeResolvergiven the type union- Specified by:
getTypeResolverin interfaceWiringFactory- Parameters:
environment- the union wiring environment- Returns:
- a
TypeResolver
-
getDefaultDataFetcher
Description copied from interface:WiringFactoryAll 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:
getDefaultDataFetcherin interfaceWiringFactory- Parameters:
environment- the wiring environment- Returns:
- a
DataFetcher
-
fakeScalar
-