use of org.springframework.graphql.execution.DefaultBatchLoaderRegistry in project spring-graphql by spring-projects.
the class BatchMappingTestSupport method createGraphQlService.
protected GraphQlService createGraphQlService(CourseController controller) {
BatchLoaderRegistry registry = new DefaultBatchLoaderRegistry();
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.registerBean(CourseController.class, () -> controller);
context.registerBean(BatchLoaderRegistry.class, () -> registry);
context.refresh();
return GraphQlSetup.schemaContent(schema).runtimeWiringForAnnotatedControllers(context).dataLoaders(registry).toGraphQlService();
}
use of org.springframework.graphql.execution.DefaultBatchLoaderRegistry in project spring-graphql by spring-projects.
the class SchemaMappingInvocationTests method graphQlService.
private GraphQlService graphQlService() {
BatchLoaderRegistry registry = new DefaultBatchLoaderRegistry();
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.register(BookController.class);
context.registerBean(BatchLoaderRegistry.class, () -> registry);
context.refresh();
return GraphQlSetup.schemaResource(BookSource.schema).runtimeWiringForAnnotatedControllers(context).dataLoaders(registry).toGraphQlService();
}
Aggregations