-
Notifications
You must be signed in to change notification settings - Fork 2k
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
⚠️ [WIP] Refactor GraphiQL to not depend on external resources #673
Conversation
This is awesome, and I hope soon it has tracing as well! |
@@ -49,7 +49,7 @@ You can also use `apollo-server-koa` for hosting the [GraphiQL](https://github.c | |||
import { graphiqlKoa } from 'apollo-server-koa'; | |||
|
|||
// Setup the /graphiql route to show the GraphiQL UI | |||
router.get('/graphiql', graphiqlKoa({ | |||
router.get('/graphiql*', graphiqlKoa({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change and not nice 😔
In express every route that matches /graphiql
is forwareded to the route handler
koa-router and restify both have different behaviour.
For koa you have to append *
and for restify .*
.
I do not see any possibility to serve the stylesheet and the javascript bundle without a breaking change. Besides inlining the code... (I would not like to do that 😅)
Edit: Also how would I provide those bundles on azure and lambda 😕 I really do not know how I could do this and I need some advice.
Any idea on how to deal with this? @martijnwalraven
New idea: What if we set up the webpack build to inline everything into the HTML file? |
I will create a new PR for this soon, since this one is a mess 😂 |
This PR will add a webpack build step to
apollo-server-module-graphiql
in order to create a graphiql bundle.Furthermore it will adjust the
apollo-server-<express,hapi,koa,lambda,micro,restify>
packages to serve the corresponding css and js bundles.Also it will utilize apollo-link for doing requests. I am also thinking about some way that consumers can customize their link stack.
Motivation:
This allows the usage of apollo-server with graphiql without depending on the internets (unpkg.com).
Also this allows further customization of the extensible GraphiQL shipped with apollo-client.
This includes simple stuff like logos or even more advanced stuff like an embedded Apollo Tracing View.
TODO:
Server Implementations
GraphiQL Implementation
Webpack
Misc