rsnext/examples/with-graphql-faunadb
Luis Alvarez D 8e2097997e
Remove getInitialProps from the faunadb example (#9427)
* Remove the global fetch

* Update API methods

* Remove getInitialProps from the page

* Add client side fetching
2019-11-15 13:21:08 -05:00
..
components Remove getInitialProps from the faunadb example (#9427) 2019-11-15 13:21:08 -05:00
graphql Remove getInitialProps from the faunadb example (#9427) 2019-11-15 13:21:08 -05:00
lib Remove getInitialProps from the faunadb example (#9427) 2019-11-15 13:21:08 -05:00
pages Remove getInitialProps from the faunadb example (#9427) 2019-11-15 13:21:08 -05:00
public/static with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
styles Remove getInitialProps from the faunadb example (#9427) 2019-11-15 13:21:08 -05:00
next.config.js with-graphql-faunadb (#9387) 2019-11-13 13:15:27 -05:00
package.json Remove getInitialProps from the faunadb example (#9427) 2019-11-15 13:21:08 -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