Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading