WunderGraph integrates with FaunaDB out of the box, no complex configuration is required.
Before we can start, you've got to set up a FaunaDB account and create a database. Please follow the steps below.
Create a FaunaDB account.
Create a database with the following options:
- Region Group: Choose the one that works best for you.
- [x] Use demo data.
Create a API token under
- Key Name:
Write down the secret displayed: if you lose it, you have to create a new one (the secret is only ever displayed once).
Rename the file
<replace-with-your-token>with the secret from step 4.
If you selected a Region Group other than Classic, replace
https://graphql.fauna.com/graphqlwith the GraphQL API endpoint suitable for your selected region group:
Once the environment is set up, we're ready to configure our application.
This configuration adds
faunaDB as a data source and configures the API key to be used. The API key of your FaunaDB instance is not exposed to the client, making it a perfect fit to secure your API.
Add an Operation
Now that everything is configured, let's add an Operation.
Calling the Operation from Next.js
And that's it! We've fully integrated FaunaDB, WunderGraph and Next.js.