public class GraphQlRSocketHandler extends Object
This class can be extended or wrapped from an @Controller in order
to re-declare handle(Map) and handleSubscription(Map) with
@MessageMapping
annotations including the GraphQL endpoint route.
@Controller
private static class GraphQlRSocketController {
private final GraphQlRSocketHandler handler;
GraphQlRSocketController(GraphQlRSocketHandler handler) {
this.handler = handler;
}
@MessageMapping("graphql")
public Mono| Constructor and Description |
|---|
GraphQlRSocketHandler(ExecutionGraphQlService graphQlService,
List<RSocketGraphQlInterceptor> interceptors,
Encoder<?> jsonEncoder)
Create a new instance that handles requests through a chain of interceptors
followed by the given
ExecutionGraphQlService. |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<Map<String,Object>> |
handle(Map<String,Object> payload)
Handle a
Request-Response interaction. |
reactor.core.publisher.Flux<Map<String,Object>> |
handleSubscription(Map<String,Object> payload)
Handle a
Request-Stream interaction. |
public GraphQlRSocketHandler(ExecutionGraphQlService graphQlService, List<RSocketGraphQlInterceptor> interceptors, Encoder<?> jsonEncoder)
ExecutionGraphQlService.graphQlService - the service that will execute the requestinterceptors - interceptors to form the processing chainjsonEncoder - a JSON encoder for serializing a
GraphQLError list for a failed subscription