File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
packages/web/docs/src/content/gateway/deployment/node-frameworks Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,29 @@ app.listen(4000, () => {
30
30
})
31
31
```
32
32
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
+
44
+ const app = express ()
45
+
46
+ const serveRuntime = createGatewayRuntime ({ renderGraphiQL })
47
+
48
+ // Bind Hive Gateway to the graphql endpoint to avoid rendering the playground on any path
49
+ app .use (serveRuntime .graphqlEndpoint , serveRuntime )
50
+
51
+ app .listen (4000 , () => {
52
+ console .log (' Running a GraphQL API server at http://localhost:4000/graphql' )
53
+ })
54
+ ```
55
+
33
56
## Using Helmet
34
57
35
58
If you are using [ Helmet] ( https://helmetjs.github.io/ ) to set your
You can’t perform that action at this time.
0 commit comments