Supergraph / Proxy Source
Hive Gateway can retrieve a supergraph from a wide range of sources.
This includes:
- Hive Schema Schema Registry
- Apollo GraphOS / Studio
- Custom Sources
In addition you can also proxy any GraphQL API, by either introspection or providing a schema file.
Supergraph
Hive Gateway has built in support for fetching supergraphs from the Hive Schema Registry. You can either choose to provide the configuration via CLI parameters, environment variables or a configuration file.
hive-gateway supergraph <endpoint> --hive-cdn-key <api_key>
Polling
You can configure the polling interval for the supergraph source.
gateway.config.ts
import { defineConfig } from '@graphql-hive/gateway'
export const gatewayConfig = defineConfig({
supergraph: {
/* Supergraph Configuration */
},
// Poll the schema registry every 10 seconds
pollingInterval: 10_000
})
Proxy
Instead of serving a supergraph, you can also use Hive Gateway to proxy any existing GraphQL API. This allows you to add features such as usage reporting or persisted documents without modifying your existing GraphQL API.
Proxy GraphQL API
hive-gateway proxy https://example.com/graphql