-
Notifications
You must be signed in to change notification settings - Fork 317
GraphiQL setup to support websockets #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Interesting! |
I'm not aware of any live samples. It's quite easy to test by overriding the index.html that this boot project serves for GraphiQL. I can provide a copy of what I used if desired. When using, GraphiQL displays the lastest message in the the query output section. Any further analysis of the websocket connection can be done in the browers debugger. GraphiQL lets you run a single subscription at a time, and terminates the websocket connection at when the subscription completes. It also turns the run button into a stop button so you can terminate the subscription early if desired. |
- Drop existing single page cdn integration from boot project. - Create new `spring-graphql-graphiql` module containing `graphiql` integration. - Makes `graphiql` optional which user can pull in as a dependency. - `spring-graphql-graphiql` is a basic npm module which packages itself as a jar where boot autoconfig can integrate to. - In a npm module graphiql itself is handled as a plain react app which allows some customisation like setting logo name to demonstrate how things are passed from boot properties into a react app itself. - GraphiQlHandler's are changed to handle all traffic into `/graphiql` order to: - Handling main html in `/graphiql/explorer` - Redirect to `/graphiql/explorer` to get context path under `/graphiql/` - Handle `main.js` from classpath to get html to load it under `/graphiql/` - Handle `config.js` as a way to pass configuration options from server side and load those into react app. There are various long threads in GH and SO discussing this problem and I chose to load settings from a server side. - Samples webmvc-http and webflux-websocket are changed to use this module. - `webmvc-http` is as it used to be. - `webflux-websocket` can now use subscription which gets first greeting instead of subscription request reply. - Fixes spring-projects#20 - Fixes spring-projects#131
- Drop existing single page cdn integration from boot project. - Create new `spring-graphql-graphiql` module containing `graphiql` integration. - Makes `graphiql` optional which user can pull in as a dependency. - `spring-graphql-graphiql` is a basic npm module which packages itself as a jar where boot autoconfig can integrate to. - In a npm module graphiql itself is handled as a plain react app which allows some customisation like setting logo name to demonstrate how things are passed from boot properties into a react app itself. - GraphiQlHandler's are changed to handle all traffic into `/graphiql` order to: - Handling main html in `/graphiql/explorer` - Redirect to `/graphiql/explorer` to get context path under `/graphiql/` - Handle `main.js` from classpath to get html to load it under `/graphiql/` - Handle `config.js` as a way to pass configuration options from server side and load those into react app. There are various long threads in GH and SO discussing this problem and I chose to load settings from a server side. - Samples webmvc-http and webflux-websocket are changed to use this module. - `webmvc-http` is as it used to be. - `webflux-websocket` can now use subscription which gets first greeting instead of subscription request reply. - Fixes spring-projects#20 - Fixes spring-projects#131
GraphiQL has utilities for creating fetchers for both HTTP and WS, currently the spring-graphql setup of GraphiQL only supports a HTTP meaning subscriptions over websocket cannot be tested via the UI:
For example, see: https://github.com/graphql/graphiql/blob/main/packages/graphiql-toolkit/docs/create-fetcher.md
The text was updated successfully, but these errors were encountered: