use of org.springframework.graphql.execution.ExecutionGraphQlService in project spring-graphql by spring-projects.
the class SchemaMappingPrincipalMethodArgumentResolverTests method executeAsync.
private Mono<RequestOutput> executeAsync(String schema, String document, Function<Context, Context> contextWriter) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.registerBean(GreetingController.class, () -> greetingController);
context.refresh();
ExecutionGraphQlService graphQlService = GraphQlSetup.schemaContent(schema).runtimeWiringForAnnotatedControllers(context).toGraphQlService();
return Mono.delay(Duration.ofMillis(10)).flatMap(aLong -> graphQlService.execute(TestRequestInput.forDocument(document))).contextWrite(contextWriter);
}
use of org.springframework.graphql.execution.ExecutionGraphQlService in project spring-graphql by spring-projects.
the class GraphQlSetup method toGraphQlService.
public ExecutionGraphQlService toGraphQlService() {
GraphQlSource source = graphQlSourceBuilder.build();
ExecutionGraphQlService service = new ExecutionGraphQlService(source);
this.dataLoaderRegistrars.forEach(service::addDataLoaderRegistrar);
return service;
}
Aggregations