© 2026 Hashnode
In this series, we will build a GraphQL API with Grafbase, and persist data with Fauna. Here's a breakdown of what we'll be building: This is part 1 Set up a Fauna Database Install and configure Fauna inside Grafbase Resolvers Create Product Muta...

The final step involves deploying your new GraphQL API to the Edge with the help of GitHub. Here's how you can do it: Sign in to your GitHub account, or create one if you don't have it yet. Initiate a new repository via GitHub. In the Grafbase Das...

We're now ready to create a GraphQL mutation that we will use to add to our products collection inside the Fauna database. A GraphQL mutation is a type of operation in GraphQL that modifies data on the server and typically look something like this: m...

We're now ready to finish the last piece of the GraphQL API by adding a new query that fetches all products from the Fauna Database. Inside grafbase/grafbase.config.ts add the following query definition: g.query('products', { resolver: 'products/al...

Let's begin by installing the Fauna JavaScript driver inside our project so that we can use it inside our first resolver: npm install fauna graphql Now create the file grafbase/resolvers/create.ts. We'll complete this inside the next step but for no...

Fauna is perfect for creating databases and databases inside of databases where you require multi-tenant support for building and scaling applications. We'll be using a single database in this guide as well as the UI for creating a database and colle...

In this step, we'll create a GraphQL mutation to delete products from the Fauna collection. To do this, update the grafbase/grafbase.config.ts file to include the following: const productDeletePayload = g.type('ProductDeletePayload', { deleted: g.b...
