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

Consider moving GraphiQL functions to a separate package. #9

Open
wtgtybhertgeghgtwtg opened this issue Jan 26, 2021 · 9 comments
Open

Comments

@wtgtybhertgeghgtwtg
Copy link

While useful, they may not be necessary for all users. It is notable that almost all of the package size of graphql-helix seems to come from dist/render-graphiql.js. While it would be a breaking change, it is relatively straightforward for users to migrate to something like

import {getGraphQLParameters, processRequest} from 'graphql-helix';
import {renderGraphiQL, shouldRenderGraphiQL} from 'graphql-helix-graphiql';
@danielrearden
Copy link
Contributor

Sounds like a sound idea. We can publish two packages @graphql-helix/core and @graphql-helix/graphiql and just export both from graphql-helix. No breaking changes needed. I'll circle back to this at my earliest convenience.

@orefalo
Copy link

orefalo commented Mar 29, 2021

I personally use Altair -my recommendation: stay light. expressjs is still around because over the releases it became lighter and lighter. You can always add an example for those in love with graphiql.

@raymclee
Copy link

I personally use Altair -my recommendation: stay light. expressjs is still around because over the releases it became lighter and lighter. You can always add an example for those in love with graphiql.

are you using altair web with helix? if so, can you please show me how to use it? Thanks!

@dotansimha
Copy link
Collaborator

I personally use Altair -my recommendation: stay light. expressjs is still around because over the releases it became lighter and lighter. You can always add an example for those in love with graphiql.

are you using altair web with helix? if so, can you please show me how to use it? Thanks!

You can just configure a POST handler in your server for Helix, and the configure GET to server Altair. Then, point Altair to the endpoint your are using for the POST :)

@dotansimha
Copy link
Collaborator

This is definitely relevant. I updated the build process of the GraphiQL package, it might not do a major effect, but will allow us later to publish it as standalone package easily, instead of serving it along with graphql-helix package.

@talentlessguy
Copy link

updates?

@n1ru4l
Copy link
Collaborator

n1ru4l commented Oct 29, 2021

@talentlessguy Wanna help with this?

@dan-lee
Copy link
Contributor

dan-lee commented Nov 16, 2021

Currently, we're using graphql-helix on Cloudflare Workers and it adds around ~1 MB per worker, which is definitely too much.
I'd be happy to help, but I don't know what the missing pieces are, or why the packages can't be released separately as they are right now.

@n1ru4l
Copy link
Collaborator

n1ru4l commented Nov 16, 2021

@dan-lee The idea would be to have the graphql-helix package which depends on @graphql-helix/core (which includes all functionality except graphiql functions) and on @graphql-helix/graphiql which has all the functions for handling graphiql.

People that are concerned about bundle size thus can only install @graphql-helix/core. graphql-helix will just re-export everything from @graphql-helix/core and @graphql-helix/graphiql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants