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
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.DefaultExecutionGraphQlRequest
ALLOWED_OPERATIONS_KEYFields inherited from class org.springframework.graphql.support.DefaultGraphQlRequest
EXTENSIONS_KEY, OPERATION_NAME_KEY, QUERY_KEY, VARIABLES_KEYFields inherited from interface org.springframework.graphql.ExecutionGraphQlRequest
ALL_OPERATIONS -
Constructor Summary
ConstructorsConstructorDescriptionWebGraphQlRequest(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.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. -
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.@Nullable InetSocketAddressReturn 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
allowedOperations, configureExecutionInput, executionId, getAllowedOperations, getExecutionId, getId, getLocale, toExecutionInput, toStringMethods inherited from class org.springframework.graphql.support.DefaultGraphQlRequest
equals, getDocument, getExtensions, getOperationName, getVariables, hashCode, toMapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
-
-
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
-