To build out our Shop products page on the frontend we will need data coming in from the database. To do that we need to connect Fauna to Next.js. We'll do this through Apollo Client because it will give us a lot right out of the box.
To connect our database we'll configure Apollo Client with httpLink
and authLink
. On the Fauna side of things we'll create a role and key for Read permissions (just Read for now) and grab the graphql endpoint to supply as environment variables for Next.js.