Grafbase Gateway
The Grafbase Gateway allows you to run a federated graph within your own infrastructure. The gateway operates by either polling the latest graph from the Grafbase API or by passing the federated schema, enabling air-gapped operation.
To install the Grafbase Gateway, run the following command:
curl -fsSL https://grafbase.com/downloads/gateway | bash
In hybrid mode, the gateway fetches the current federated graph from the Grafbase platform. Create a federated graph in the Grafbase API, publish the subgraphs, and the gateway will always have the current graph running.
Start the gateway in hybrid mode with the graph reference and an organization access token:
GRAFBASE_ACCESS_TOKEN=token ./grafbase-gateway \
--config grafbase.toml \
--graph-ref graph@branch
graph-ref
points to a graph created in the Grafbase API and its branch. If the branch is empty, the gateway uses the production branch by default.
Create the organization access token in the account settings under "Access Tokens" and ensure it has permission to read the graph.
The gateway polls for graph changes every ten seconds.
In air-gapped mode, the gateway never calls the Grafbase API. You must provide the federated graph SDL as a file.
Start the gateway in self-hosted mode:
./grafbase-gateway \
--config /path/to/grafbase.toml \
--schema /path/to/federated-schema.graphql \
--listen-address 127.0.0.1:4000
The Grafbase Gateway reads its configuration from a TOML file. Read the configuration reference for more information.