graphql-helix icon indicating copy to clipboard operation
graphql-helix copied to clipboard

Consider moving GraphiQL functions to a separate package.

Open wtgtybhertgeghgtwtg opened this issue 3 years ago • 9 comments

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';

wtgtybhertgeghgtwtg avatar Jan 26 '21 11:01 wtgtybhertgeghgtwtg

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.

danielrearden avatar Jan 28 '21 11:01 danielrearden

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.

orefalo avatar Mar 29 '21 17:03 orefalo

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!

raymclee avatar Jun 23 '21 17:06 raymclee

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 avatar Sep 23 '21 16:09 dotansimha

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.

dotansimha avatar Sep 23 '21 16:09 dotansimha

updates?

talentlessguy avatar Oct 29 '21 17:10 talentlessguy

@talentlessguy Wanna help with this?

n1ru4l avatar Oct 29 '21 17:10 n1ru4l

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.

dan-lee avatar Nov 16 '21 09:11 dan-lee

@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

n1ru4l avatar Nov 16 '21 10:11 n1ru4l