Skip to content
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

Closed
wants to merge 8 commits into from

Conversation

n1ru4l
Copy link
Contributor

@n1ru4l n1ru4l commented Nov 15, 2017

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

  • express
  • hapi
  • koa
  • lambda
  • micro
  • restify

GraphiQL Implementation

  • Check websocket support

Webpack

  • Setup Typescript
  • Remove unused dependencies
  • Optimize output code

Misc

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@stubailo
Copy link
Contributor

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({
Copy link
Contributor Author

@n1ru4l n1ru4l Nov 19, 2017

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

@stubailo
Copy link
Contributor

stubailo commented Dec 5, 2017

New idea: What if we set up the webpack build to inline everything into the HTML file?

@n1ru4l
Copy link
Contributor Author

n1ru4l commented Dec 19, 2017

I will create a new PR for this soon, since this one is a mess 😂

@n1ru4l n1ru4l closed this Dec 19, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants