diff --git a/packages/web/docs/src/content/gateway/deployment/node-frameworks/express.mdx b/packages/web/docs/src/content/gateway/deployment/node-frameworks/express.mdx index 70e7b9ec10..9289b886fd 100644 --- a/packages/web/docs/src/content/gateway/deployment/node-frameworks/express.mdx +++ b/packages/web/docs/src/content/gateway/deployment/node-frameworks/express.mdx @@ -30,6 +30,30 @@ app.listen(4000, () => { }) ``` +## Offline Usage + +By default, GraphiQL code is served from a CDN because to decrease bundle size. If you want to use +GraphiQL from a local version, you need to install it manually. + +You need to pass imported `renderGraphiQL` to `createGatewayRuntime` like below: + +```ts filename="Render GraphiQL offline" +import express from 'express' +import { createGatewayRuntime } from '@graphql-hive/gateway-runtime' +import { renderGraphiQL } from '@graphql-yoga/render-graphiql' + +const app = express() + +const serveRuntime = createGatewayRuntime({ renderGraphiQL }) + +// Bind Hive Gateway to the graphql endpoint to avoid rendering the playground on any path +app.use(serveRuntime.graphqlEndpoint, serveRuntime) + +app.listen(4000, () => { + console.log('Running a GraphQL API server at http://localhost:4000/graphql') +}) +``` + ## Using Helmet If you are using [Helmet](https://helmetjs.github.io/) to set your