Class GraphQlRSocketHandler
java.lang.Object
org.springframework.graphql.server.GraphQlRSocketHandler
Handler for GraphQL over RSocket requests.
 
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<Map<String, Object>> handle(Map<String, Object> payload) {
        return this.handler.handle(payload);
    }
    @MessageMapping("graphql")
    public Flux<Map<String, Object>> handleSubscription(Map<String, Object> payload) {
        return this.handler.handleSubscription(payload);
    }
 }
 - Since:
- 1.0.0
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructorsConstructorDescriptionGraphQlRSocketHandler(ExecutionGraphQlService graphQlService, List<RSocketGraphQlInterceptor> interceptors, Encoder<?> jsonEncoder) Create a new instance that handles requests through a chain of interceptors followed by the givenExecutionGraphQlService.
- 
Method Summary
- 
Constructor Details- 
GraphQlRSocketHandlerpublic GraphQlRSocketHandler(ExecutionGraphQlService graphQlService, List<RSocketGraphQlInterceptor> interceptors, Encoder<?> jsonEncoder) Create a new instance that handles requests through a chain of interceptors followed by the givenExecutionGraphQlService.- Parameters:
- graphQlService- the service that will execute the request
- interceptors- interceptors to form the processing chain
- jsonEncoder- a JSON encoder for serializing a- GraphQLErrorlist for a failed subscription
 
 
- 
- 
Method Details- 
handleHandle aRequest-Responseinteraction. For queries and mutations.- Parameters:
- payload- the decoded GraphQL request payload
 
- 
handleSubscriptionpublic reactor.core.publisher.Flux<Map<String,Object>> handleSubscription(Map<String, Object> payload) Handle aRequest-Streaminteraction. For subscriptions.- Parameters:
- payload- the decoded GraphQL request payload
 
 
-