Grafbase Gateway
Grafbase Gateway is a Rust-based GraphQL gateway implementation for Apollo Federation.
Starting from version 0.52.0, Grafbase Gateway has a built-in integration with Hive Console, allowing you to fetch your supergraph schema directly from Hive Console CDN and report usage metrics. You can also use Persisted Documents feature to store and manage your GraphQL operations in Hive.
Configuration
Use the following environment variables to configure Grafbase Gateway with Hive Console:
-
HIVE_CDN_ENDPOINT: The Hive CDN Endpoint of your target. -
HIVE_CDN_KEY: The Hive CDN key/token of your target. -
HIVE_CDN_POLL_INTERVAL: An optional human-readable string representing the interval at which the gateway should poll Hive CDN for changes. Default is10s. -
HIVE_ACCESS_TOKEN: Your Registry Access Token with write permission. -
HIVE_TARGET: A target ID, this can either be a slug following the format$organizationSlug/$projectSlug/$targetSlug(e.gthe-guild/graphql-hive/staging) or an UUID (e.g.a0f4c605-6541-4350-8cfe-b31f21a4bf80). To be used when the token is configured with an organization access token.
Setting the environment variables mentioned above will enable Grafbase Gateway to fetch the supergraph schema from Hive CDN and report usage metrics to Hive Console.
Persisted Operations / App Deployments
Grafbase Gateway’s Trusted Documents feature integrates perfectly with Hive Console’s App Deployments, in order to serve persisted operations. To enable this feature, you need to set the CDN variables above.
- Learn more how to use this feature in Grafbase Gateway.
- Learn more about Persisted Documents in Hive Console.
Client Information on Hive Console
Grafbase Gateway uses x-grafbase-client-name and x-grafbase-client-version HTTP headers to get
the client information. Hive Console integration also uses these headers.
So if you want to differentiate the GraphQL clients in Hive Console, you can set custom values for these headers in your GraphQL clients.