Class WebGraphQlRequest

All Implemented Interfaces:
ExecutionGraphQlRequest, GraphQlRequest
Direct Known Subclasses:
WebSocketGraphQlRequest

public class WebGraphQlRequest extends DefaultExecutionGraphQlRequest
GraphQlRequest implementation for server handling over HTTP or WebSocket. Provides access to the URL and headers of the underlying request. For WebSocket, these are the URL and headers of the HTTP handshake request.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • WebGraphQlRequest

      public WebGraphQlRequest(URI uri, HttpHeaders headers, @Nullable MultiValueMap<String, HttpCookie> cookies, @Nullable InetSocketAddress remoteAddress, Map<String,Object> attributes, GraphQlRequest body, String id, @Nullable Locale locale)
      Create an instance.
      Parameters:
      uri - the URL for the HTTP request or WebSocket handshake
      headers - the HTTP request headers
      cookies - the HTTP request cookies
      remoteAddress - the HTTP client remote address
      attributes - request attributes
      body - the deserialized content of the GraphQL request
      id - an identifier for the GraphQL request
      locale - the locale from the HTTP request, if any
      Since:
      1.3.0
    • WebGraphQlRequest

      public WebGraphQlRequest(URI uri, HttpHeaders headers, @Nullable MultiValueMap<String, HttpCookie> cookies, @Nullable InetSocketAddress remoteAddress, Map<String,Object> attributes, Map<String,Object> body, String id, @Nullable Locale locale)
      Constructor variant with a Map for the request body.
      Parameters:
      uri - the URL for the HTTP request or WebSocket handshake
      headers - the HTTP request headers
      cookies - the HTTP request cookies
      remoteAddress - the HTTP client remote address
      attributes - request attributes
      body - the deserialized content of the GraphQL request
      id - an identifier for the GraphQL request
      locale - the locale from the HTTP request, if any
      Since:
      1.3.0
  • Method Details

    • getUri

      public UriComponents getUri()
      Return the URL for the HTTP request or WebSocket handshake.
    • getHeaders

      public HttpHeaders getHeaders()
      Return the HTTP headers of the request or WebSocket handshake.
    • getCookies

      public MultiValueMap<String, HttpCookie> getCookies()
      Return the cookies of the request of WebSocket handshake.
      Since:
      1.1.3
    • getRemoteAddress

      public @Nullable InetSocketAddress getRemoteAddress()
      Return the remote address of the client, if available.
      Since:
      1.3.0
    • getAttributes

      public Map<String,Object> getAttributes()
      Return the request or WebSocket session attributes.
      Since:
      1.1.3