Runtime
Grafbase supports multiple runtimes for your graphs. Each runtime has its own set of libraries, APIs, and functionality that provides different trade-offs and benefits.
The Edge runtime is built on top of the V8 engine, allowing it to run in isolated execution environments that don't require a container or virtual machine.
Graphs using the Edge runtime execute in the data center closest to the user. This can result in a much lower latency and allows you to provide personalization at speed.
The Edge runtime provides a subset of Web APIs such as fetch, Request, and Response. This lightweight API layer is built to be performant and execute code with minimal latency.
Graphs using the Node.js runtime support all Node.js APIs, including standard Web APIs such as the Request and Response Objects.
To enable the Node.js runtime, you need to set the experimental runtime
feature to nodejs
in the configuration:
import { config, graph } from '@grafbase/sdk'
const g = graph.Standalone()
export default config({
graph: g,
experimental: {
runtime: 'nodejs',
},
})
Graphs using the Node.js runtime are currently deployed to the AWS us-east-1 region, but we will enable more regions over time. Contact us if you need support for more regions.