Fauna GQL Upload

Github Twitter

🏹 Getting started


Fauna GQL Upload needs a local installation of faunadb. That means you need to install both fauna-gql-upload and faunadb.

With npm:

npm install --save-dev fauna-gql-upload faunadb

With yarn:

yarn add -D fauna-gql-upload faunadb

NOTE: You do not need to install faunadb as a development dependency. You could also install it normally if you use it as part of your frontend or in other backend code.

Adding npm script

You will need to add an npm script to the command.


"scripts": {
  "fauna": "fgu" // you can use 'fgu' or 'fauna-gql'

Running it:

npm run fauna


yarn fauna

Files and directories

For the command to work properly, you need to have certain information in your project.


To upload your resources, simply run the previously configured command.

with npm:

npm run fauna

with yarn:

yarn fauna

NOTE: As you will notice, all of the resource examples below are using import/export syntax. This is not supported in node by default, but Fauna GQL Upload builds all of your resources using esbuild which makes this syntax work without extra configuration on your part.