Interface GraphQlTransport


public interface GraphQlTransport
Contract for executing GraphQL requests over some transport.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • Method Details

    • execute

      reactor.core.publisher.Mono<GraphQlResponse> execute(GraphQlRequest request)
      Execute a request with a single response such as a "query" or "mutation".
      Parameters:
      request - the request to execute
      Returns:
      a Mono with the GraphQlResponse for the response. The Mono may end wth an error due to transport or other issues such as failures to encode the request or decode the response.
    • executeSubscription

      reactor.core.publisher.Flux<GraphQlResponse> executeSubscription(GraphQlRequest request)
      Execute a "subscription" request with a stream of responses.
      Parameters:
      request - the request to execute
      Returns:
      a Flux of GraphQlResponse responses. The Flux may terminate as follows:
      • Completes if the subscription completes before the connection is closed.
      • SubscriptionErrorException if the subscription ends with an error.
      • WebSocketDisconnectedException if the connection is closed or lost before the stream terminates.
      • Exception for connection and GraphQL session initialization issues.

      The Flux may be cancelled to notify the server to end the subscription stream.

    • createResponse

      static GraphQlResponse createResponse(Map<String,Object> responseMap)
      Factory method to create GraphQlResponse from a GraphQL response map for use in transport implementations.
      Parameters:
      responseMap - the GraphQL response map