Deploying Hive Gateway to Cloudflare Workers
Hive Gateway a provides you a cross-platform GraphQL Server. So you can easily integrate it into any platform besides Node.js.
Cloudflare Workers provides a serverless execution environment that allows you to create entirely new applications or augment existing ones without configuring or maintaining infrastructure.
💡
Before you start, make sure you read the Serverless / On the Edge page.
See Bundling Problems for more details about
how to load the supergraph and transports
option.
index.js
import { createGatewayRuntime } from '@graphql-hive/gateway'
import http from '@graphql-mesh/transport-http'
import supergraph from './supergraph'
export const gateway = createGatewayRuntime({
// All options available in `gateway.config.ts` configuration can also be passed here.
supergraph,
transports: {
http // For example, http transport is required for subgraphs using standard GraphQL over HTTP.
}
})
export default { fetch: gateway }
supergraph.js
export default /* GraphQL */ `
PLACE YOUR SUPERGRAPH SDL HERE
`
💡
If you want to use Cloudflare KV Cache as a distributed cache, see here for Hive Gateway integration