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.
| Constructor and Description |
|---|
AnnotatedControllerConfigurer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFormatterRegistrar(FormatterRegistrar registrar)
Add a
FormatterRegistrar to customize the ConversionService
that assists in binding GraphQL arguments onto
@Argument
annotated method parameters. |
void |
afterPropertiesSet() |
void |
configure(GraphQLCodeRegistry.Builder codeRegistryBuilder)
Alternative to
configure(RuntimeWiring.Builder) that registers
data fetchers in a GraphQLCodeRegistry.Builder. |
void |
configure(RuntimeWiring.Builder runtimeWiringBuilder)
Apply changes to the
RuntimeWiring.Builder such as registering
DataFetchers, custom scalar types, and more. |
protected ApplicationContext |
obtainApplicationContext() |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setDataBinderInitializer(Consumer<DataBinder> dataBinderInitializer)
Configure an initializer that configures the
DataBinder before the binding process. |
void |
setExecutor(Executor executor)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconfigurepublic void addFormatterRegistrar(FormatterRegistrar registrar)
FormatterRegistrar to customize the ConversionService
that assists in binding GraphQL arguments onto
@Argument
annotated method parameters.public void setExecutor(Executor executor)
Executor to use for asynchronous handling of
Callable return values from controller methods.
By default, this is not set in which case controller methods with a
Callable return value cannot be registered.
executor - the executor to usepublic void setDataBinderInitializer(@Nullable Consumer<DataBinder> dataBinderInitializer)
DataBinder before the binding process.dataBinderInitializer - the data binder initializerpublic void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext in interface ApplicationContextAwarepublic void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanprotected final ApplicationContext obtainApplicationContext()
public void configure(RuntimeWiring.Builder runtimeWiringBuilder)
RuntimeWiringConfigurerRuntimeWiring.Builder such as registering
DataFetchers, custom scalar types, and more.configure in interface RuntimeWiringConfigurerruntimeWiringBuilder - the builder to configurepublic void configure(GraphQLCodeRegistry.Builder codeRegistryBuilder)
configure(RuntimeWiring.Builder) that registers
data fetchers in a GraphQLCodeRegistry.Builder. This could be
used with programmatic creation of GraphQLSchema.