34a38d2e40
This configures our linting to exit without a success status code when warnings are found |
||
---|---|---|
.. | ||
components | ||
fetch | ||
graphql | ||
pages | ||
public/static | ||
styles | ||
next.config.js | ||
package.json | ||
README.md | ||
schema.gql |
FaunaDB Graphql Starter Example -- The FaunaDB Guestbook
This simple Guestbook SPA example shows you how to use FaunaDB's GraphQL endpoint in your Next.js project. [Live demo].
Why FaunaDB
By importing a .gql
or .graphql
schema into FaunaDB (see our sample schema file), FaunaDB will generate required Indexes and GraphQL resolvers for you -- hands free 👐 (some limitations exist).
How to use
You can start with this template using create-next-app
or by downloading the repository manually.
To use a live FaunaDB database, create one and import this example's schema.gql
file using the FaunaDB console. Create a client secret, then paste it into next.config.js
.
Using create-next-app
Execute create-next-app
with Yarn or npx to bootstrap the example:
npx create-next-app --example with-graphql-faunadb with-graphql-faunadb
# or
yarn create next-app --example with-graphql-faunadb with-graphql-faunadb
Download manually
Download the example:
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-graphql-faunadb
cd with-graphql-faunadb
Run locally
Install packages, then run the development server:
npm install
npm run dev
# or
yarn
yarn dev
Make sure to leave us a guestbook message in our live demo! 😉
Deploy
Deploy it to the cloud with now! Install now on your development machine before proceeding.
now