File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
packages/web/docs/src/content/gateway/deployment/node-frameworks Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,30 @@ app.listen(4000, () => {
3030})
3131```
3232
33+ ## Offline Usage
34+
35+ By default, GraphiQL code is served from a CDN because to decrease bundle size. If you want to use
36+ GraphiQL from a local version, you need to install it manually.
37+
38+ You need to pass imported ` renderGraphiQL ` to ` createGatewayRuntime ` like below:
39+
40+ ``` ts filename="Render GraphiQL offline"
41+ import express from ' express'
42+ import { createGatewayRuntime } from ' @graphql-hive/gateway-runtime'
43+ import { renderGraphiQL } from ' @graphql-yoga/render-graphiql'
44+
45+ const app = express ()
46+
47+ const serveRuntime = createGatewayRuntime ({ renderGraphiQL })
48+
49+ // Bind Hive Gateway to the graphql endpoint to avoid rendering the playground on any path
50+ app .use (serveRuntime .graphqlEndpoint , serveRuntime )
51+
52+ app .listen (4000 , () => {
53+ console .log (' Running a GraphQL API server at http://localhost:4000/graphql' )
54+ })
55+ ```
56+
3357## Using Helmet
3458
3559If you are using [ Helmet] ( https://helmetjs.github.io/ ) to set your
You can’t perform that action at this time.
0 commit comments