-
Notifications
You must be signed in to change notification settings - Fork 317
Consider graphiQL integration #20
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
Nice to add this, but it - at least for prod - it should be opt-in. |
- 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
The initial approach we took, embedding an HTML page that depends on static resources hosted on CDNs seems to work pretty well so far. We've evolved the configuration and features quite a bit since and I don't think this has shown strong limitations. We'll keep this strategy and won't commit to a custom GraphiQL build with more advanced features for now. |
As of #12, we're shipping a very simple graphiQL integration with spring-graphql. The current version ships a single HTML page that depends on static resources on 3rd party CDNs, with well-known front-end libraries.
There are several issues with it that we should discuss:
The text was updated successfully, but these errors were encountered: