Add DataLoaderMethodArgumentResolver

This commit adds support for DataLoader<K,V> arguments on annotated
handler methods, where the key for the lookup is the class name of the
value type or the parameter name.

See gh-63
This commit is contained in:
Rossen Stoyanchev
2021-09-14 09:11:10 +01:00
parent ddafc93c6c
commit 1bdcb8afe8
7 changed files with 352 additions and 31 deletions

View File

@@ -76,9 +76,9 @@ public class GraphQlWebFluxAutoConfiguration {
@Bean
public AnnotatedDataFetcherConfigurer annotatedDataFetcherConfigurer(ServerCodecConfigurer configurer) {
AnnotatedDataFetcherConfigurer registrar = new AnnotatedDataFetcherConfigurer();
registrar.setServerCodecConfigurer(configurer);
return registrar;
AnnotatedDataFetcherConfigurer dataFetcherConfigurer = new AnnotatedDataFetcherConfigurer();
dataFetcherConfigurer.setServerCodecConfigurer(configurer);
return dataFetcherConfigurer;
}
@Bean

View File

@@ -84,9 +84,9 @@ public class GraphQlWebMvcAutoConfiguration {
@Bean
public AnnotatedDataFetcherConfigurer annotatedDataFetcherConfigurer(HttpMessageConverters converters) {
AnnotatedDataFetcherConfigurer registrar = new AnnotatedDataFetcherConfigurer();
registrar.setJsonMessageConverter(getJsonConverter(converters));
return registrar;
AnnotatedDataFetcherConfigurer dataFetcherConfigurer = new AnnotatedDataFetcherConfigurer();
dataFetcherConfigurer.setJsonMessageConverter(getJsonConverter(converters));
return dataFetcherConfigurer;
}
@SuppressWarnings("unchecked")