Class WebGraphQlRequest
java.lang.Object
org.springframework.graphql.support.DefaultGraphQlRequest
org.springframework.graphql.support.DefaultExecutionGraphQlRequest
org.springframework.graphql.server.WebGraphQlRequest
- All Implemented Interfaces:
ExecutionGraphQlRequest
,GraphQlRequest
- Direct Known Subclasses:
WebSocketGraphQlRequest
public class WebGraphQlRequest
extends DefaultExecutionGraphQlRequest
implements ExecutionGraphQlRequest
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
-
Field Summary
Fields inherited from class org.springframework.graphql.support.DefaultGraphQlRequest
EXTENSIONS_KEY, OPERATION_NAME_KEY, QUERY_KEY, VARIABLES_KEY
-
Constructor Summary
ConstructorDescriptionWebGraphQlRequest
(URI uri, HttpHeaders headers, MultiValueMap<String, HttpCookie> cookies, InetSocketAddress remoteAddress, Map<String, Object> attributes, Map<String, Object> body, String id, Locale locale) Constructor variant with a Map for the request body.WebGraphQlRequest
(URI uri, HttpHeaders headers, MultiValueMap<String, HttpCookie> cookies, InetSocketAddress remoteAddress, Map<String, Object> attributes, GraphQlRequest body, String id, Locale locale) Create an instance.WebGraphQlRequest
(URI uri, HttpHeaders headers, MultiValueMap<String, HttpCookie> cookies, Map<String, Object> attributes, Map<String, Object> body, String id, Locale locale) Deprecated, for removal: This API element is subject to removal in a future version.WebGraphQlRequest
(URI uri, HttpHeaders headers, MultiValueMap<String, HttpCookie> cookies, Map<String, Object> attributes, GraphQlRequest body, String id, Locale locale) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionReturn the request or WebSocket session attributes.Return the cookies of the request of WebSocket handshake.Return the HTTP headers of the request or WebSocket handshake.Return the remote address of the client, if available.getUri()
Return the URL for the HTTP request or WebSocket handshake.Methods inherited from class org.springframework.graphql.support.DefaultExecutionGraphQlRequest
configureExecutionInput, executionId, getExecutionId, getId, getLocale, toExecutionInput, toString
Methods inherited from class org.springframework.graphql.support.DefaultGraphQlRequest
equals, getDocument, getExtensions, getOperationName, getVariables, hashCode, toMap
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.graphql.ExecutionGraphQlRequest
configureExecutionInput, executionId, getExecutionId, getId, getLocale, toExecutionInput
Methods inherited from interface org.springframework.graphql.GraphQlRequest
getDocument, getExtensions, getOperationName, getVariables, toMap
-
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 handshakeheaders
- the HTTP request headerscookies
- the HTTP request cookiesremoteAddress
- the HTTP client remote addressattributes
- request attributesbody
- the deserialized content of the GraphQL requestid
- an identifier for the GraphQL requestlocale
- 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 handshakeheaders
- the HTTP request headerscookies
- the HTTP request cookiesremoteAddress
- the HTTP client remote addressattributes
- request attributesbody
- the deserialized content of the GraphQL requestid
- an identifier for the GraphQL requestlocale
- the locale from the HTTP request, if any- Since:
- 1.3.0
-
WebGraphQlRequest
@Deprecated(since="1.3.0", forRemoval=true) public WebGraphQlRequest(URI uri, HttpHeaders headers, @Nullable MultiValueMap<String, HttpCookie> cookies, Map<String, Object> attributes, GraphQlRequest body, String id, @Nullable Locale locale) Deprecated, for removal: This API element is subject to removal in a future version.Create an instance.- Parameters:
uri
- the URL for the HTTP request or WebSocket handshakeheaders
- the HTTP request headerscookies
- the HTTP request cookiesattributes
- request attributesbody
- the deserialized content of the GraphQL requestid
- an identifier for the GraphQL requestlocale
- the locale from the HTTP request, if any- Since:
- 1.2.5
-
WebGraphQlRequest
@Deprecated(since="1.3.0", forRemoval=true) public WebGraphQlRequest(URI uri, HttpHeaders headers, @Nullable MultiValueMap<String, HttpCookie> cookies, Map<String, Object> attributes, Map<String, Object> body, String id, @Nullable Locale locale) Deprecated, for removal: This API element is subject to removal in a future version.Create an instance.- Parameters:
uri
- the URL for the HTTP request or WebSocket handshakeheaders
- the HTTP request headerscookies
- the HTTP request cookiesattributes
- request attributesbody
- the deserialized content of the GraphQL requestid
- an identifier for the GraphQL requestlocale
- the locale from the HTTP request, if any- Since:
- 1.1.3
-
-
Method Details
-
getUri
Return the URL for the HTTP request or WebSocket handshake. -
getHeaders
Return the HTTP headers of the request or WebSocket handshake. -
getCookies
Return the cookies of the request of WebSocket handshake.- Since:
- 1.1.3
-
getRemoteAddress
Return the remote address of the client, if available.- Since:
- 1.3.0
-
getAttributes
Return the request or WebSocket session attributes.- Since:
- 1.1.3
-
WebGraphQlRequest(URI, HttpHeaders, MultiValueMap, InetSocketAddress, Map, Map, String, Locale)