Introducing Node.js runtime support

Jakub WieczorekJakub WieczorekMarc MettkeMarc Mettke
Introducing Node.js runtime support

When we launched Grafbase, we introduced the Edge runtime, which is built on top of the V8 engine. This runtime allows you to run your graphs in isolated execution environments without the need for a container or virtual machine. The Edge runtime executes in the data center closest to the user, resulting in lower latency and enabling business logic to execute at speed.

Over the past years, we learned from our customers migrating legacy code bases to Grafbase require more flexibility and access to the full Node.js API.

Today we’re excited to introduce the ability to configure the Node.js runtime for your graphs deployed to Grafbase. This runtime supports all Node.js APIs, including standard Web APIs such as the Request and Response Objects. This means you can connect to databases without restrictions as an example.

To enable the Node.js runtime, you need to set the experimental runtime feature to nodejs in your Grafbase 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 support for more regions is coming soon.

Read more about configuring the Grafbase runtime in the documentation.

We'd love to hear your feedback and ideas, so join us on Discord.