Package graphql.schema.idl
Class EchoingWiringFactory
- java.lang.Object
-
- graphql.schema.idl.EchoingWiringFactory
-
- All Implemented Interfaces:
WiringFactory
public class EchoingWiringFactory extends java.lang.Object implements 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 Constructor Description EchoingWiringFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GraphQLScalarType
fakeScalar(java.lang.String name)
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 providedTypeResolver
getTypeResolver(InterfaceWiringEnvironment environment)
Returns aTypeResolver
given the type interfaceTypeResolver
getTypeResolver(UnionWiringEnvironment environment)
Returns aTypeResolver
given the type unionstatic RuntimeWiring
newEchoingWiring()
static RuntimeWiring
newEchoingWiring(java.util.function.Consumer<RuntimeWiring.Builder> builderConsumer)
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-
Methods 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
getDataFetcher, getDataFetcherFactory, getScalar, getSchemaDirectiveWiring, providesDataFetcher, providesDataFetcherFactory, providesScalar, providesSchemaDirectiveWiring
-
-
-
-
Method Detail
-
newEchoingWiring
public static RuntimeWiring newEchoingWiring()
-
newEchoingWiring
public static RuntimeWiring newEchoingWiring(java.util.function.Consumer<RuntimeWiring.Builder> builderConsumer)
-
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
-
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
-
fakeScalar
public static GraphQLScalarType fakeScalar(java.lang.String name)
-
-