Class GraphiQlHandler
java.lang.Object
org.springframework.graphql.server.webflux.GraphiQlHandler
Spring WebFlux handler to serve a GraphiQl UI page.
- Since:
- 1.0.0
- Author:
- Brian Clozel, Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionGraphiQlHandler
(String graphQlPath, String graphQlWsPath) Constructor that serves the defaultgraphiql/index.html
included in thespring-graphql
module.GraphiQlHandler
(String graphQlPath, String graphQlWsPath, Resource htmlResource) Constructor with the HTML page to serve. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<ServerResponse>
handleRequest
(ServerRequest request) Render the GraphiQL page as "text/html", or if the "path" query parameter is missing, add it and redirect back to the same URL.
-
Constructor Details
-
GraphiQlHandler
Constructor that serves the defaultgraphiql/index.html
included in thespring-graphql
module.- Parameters:
graphQlPath
- the path to the GraphQL endpointgraphQlWsPath
- optional path to the GraphQL WebSocket endpoint
-
GraphiQlHandler
Constructor with the HTML page to serve.- Parameters:
graphQlPath
- the path to the GraphQL endpointgraphQlWsPath
- optional path to the GraphQL WebSocket endpointhtmlResource
- the GraphiQL page to serve
-
-
Method Details
-
handleRequest
Render the GraphiQL page as "text/html", or if the "path" query parameter is missing, add it and redirect back to the same URL.- Parameters:
request
- the HTTP server request
-