mercurius-js / mercurius

Implement GraphQL servers and gateways with Fastify
https://mercurius.dev/
MIT License
2.36k stars 237 forks source link

local graphiql front-end sources for offline development #1063

Open mikaelkaron opened 11 months ago

mikaelkaron commented 11 months ago

at the moment graphiql loads all of it's front-end resource from unpkg - this works fine if you are online while developing, but is less than ideal when offline.

these are the sources loaded from unpkg:

'https://unpkg.com/react@18.2.0/umd/react.production.min.js',
'https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js',
'https://unpkg.com/graphiql@2.0.9/graphiql.min.js'

related: platformatic/platformatic#1944

mcollina commented 11 months ago

the reason I’ve implemented it in this way is to keep the package from npm small, and avoid a complex build step.

I think the best idea would be to split it into another package, similarly to what we did for fastify-swagger-ui.