Class AnnotatedControllerConfigurer
java.lang.Object
org.springframework.graphql.data.method.annotation.support.AnnotatedControllerConfigurer
- All Implemented Interfaces:
Aware,InitializingBean,ApplicationContextAware,RuntimeWiringConfigurer
public class AnnotatedControllerConfigurer
extends Object
implements ApplicationContextAware, InitializingBean, RuntimeWiringConfigurer
RuntimeWiringConfigurer that detects @SchemaMapping
annotated handler methods in @Controller classes and
registers them as DataFetchers.
In addition to initializing a RuntimeWiring.Builder, this class, also
provides an option to configure
data fetchers on a GraphQLCodeRegistry.Builder.
- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev, Brian Clozel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFormatterRegistrar(FormatterRegistrar registrar) Add aFormatterRegistrarto customize theConversionServicethat assists in binding GraphQL arguments onto@Argumentannotated method parameters.voidvoidconfigure(GraphQLCodeRegistry.Builder codeRegistryBuilder) Alternative toconfigure(RuntimeWiring.Builder)that registers data fetchers in aGraphQLCodeRegistry.Builder.voidconfigure(RuntimeWiring.Builder runtimeWiringBuilder) Apply changes to theRuntimeWiring.Buildersuch as registeringDataFetchers, custom scalar types, and more.protected final ApplicationContextvoidsetApplicationContext(ApplicationContext applicationContext) voidsetDataBinderInitializer(Consumer<DataBinder> consumer) Deprecated, for removal: This API element is subject to removal in a future version.voidsetExecutor(Executor executor) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.graphql.execution.RuntimeWiringConfigurer
configure
-
Constructor Details
-
AnnotatedControllerConfigurer
public AnnotatedControllerConfigurer()
-
-
Method Details
-
addFormatterRegistrar
Add aFormatterRegistrarto customize theConversionServicethat assists in binding GraphQL arguments onto@Argumentannotated method parameters. -
setExecutor
Configure anExecutorto use for asynchronous handling ofCallablereturn values from controller methods.By default, this is not set in which case controller methods with a
Callablereturn value cannot be registered.- Parameters:
executor- the executor to use
-
setDataBinderInitializer
@Deprecated(since="1.1.0", forRemoval=true) public void setDataBinderInitializer(@Nullable Consumer<DataBinder> consumer) Deprecated, for removal: This API element is subject to removal in a future version.this property is deprecated, ignored, and should not be necessary as aDataBinderis no longer used to bind argumentsConfigure an initializer that configures theDataBinderbefore the binding process.- Parameters:
consumer- the data binder initializer- Since:
- 1.0.1
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean
-
obtainApplicationContext
-
configure
Description copied from interface:RuntimeWiringConfigurerApply changes to theRuntimeWiring.Buildersuch as registeringDataFetchers, custom scalar types, and more.- Specified by:
configurein interfaceRuntimeWiringConfigurer- Parameters:
runtimeWiringBuilder- the builder to configure
-
configure
Alternative toconfigure(RuntimeWiring.Builder)that registers data fetchers in aGraphQLCodeRegistry.Builder. This could be used with programmatic creation ofGraphQLSchema.
-
DataBinderis no longer used to bind arguments