Interface GraphQlClient

All Known Subinterfaces:
HttpGraphQlClient, RSocketGraphQlClient, WebGraphQlClient, WebSocketGraphQlClient
All Known Implementing Classes:
AbstractDelegatingGraphQlClient

public interface GraphQlClient
Define a workflow to execute GraphQL requests that is independent of the underlying transport.

For most cases, use a transport specific extension:

Alternatively, create an instance with any other transport via builder(GraphQlTransport). Or create a transport specific extension similar to HTTP and WebSocket.

Since:
1.0.0
Author:
Rossen Stoyanchev
  • Method Details

    • document

      GraphQlClient.RequestSpec document(String document)
      Start defining a GraphQL request with the given document, which is the textual representation of an operation (or operations) to perform, including selection sets and fragments.
      Parameters:
      document - the document for the request
      Returns:
      spec to further define or execute the request
    • documentName

      GraphQlClient.RequestSpec documentName(String name)
      Variant of document(String) that uses the given key to resolve the GraphQL document from a file with the help of the configured DocumentSource.
      Throws:
      IllegalArgumentException - if the content could not be loaded
    • mutate

      Return a builder initialized from the configuration of "this" client to use to build a new, independently configured client instance.
    • builder

      static GraphQlClient.Builder<?> builder(GraphQlTransport transport)
      Create a builder with the given custom GraphQlTransport.

      For most cases, use a transport specific extension such as HttpGraphQlClient or WebSocketGraphQlClient. This method is for use with a custom GraphQlTransport.

      Parameters:
      transport - the transport to execute requests with
      Returns:
      the builder for further initialization