rsnext/examples/with-graphql-faunadb
Joe Haddad 34a38d2e40
Linting should be strict (#9418)
This configures our linting to exit without a success status code when warnings are found
2019-11-14 23:01:36 -08:00
..
components Linting should be strict (#9418) 2019-11-14 23:01:36 -08:00
fetch with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
graphql with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
pages with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
public/static with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
styles with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
next.config.js with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
package.json with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
README.md Updated readme (#9405) 2019-11-13 16:26:08 -05:00
schema.gql with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00

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