Clone this repo and cd into directory.
git clone [email protected]:alexanderalmstrom/fauna-demo.git
cd fauna-demo
Install npm dependencies.
yarn install
Create a .env.local
file in the root and replace XXX with your Fauna secret key. Create your account and key at https://fauna.com/
REACT_APP_FAUNA_SECRET=XXX
Import schema.graphql
in Fauna dashboard.
Create some products in the GraphQL playground tab with mutations.
mutation CreateProduct {
createProduct(
data: {
name: "Some product name"
description: "Some product description"
price: 100.00
}
) {
name
description
price
}
}
List all products with
query ListProducts {
allProducts {
data {
name
description
price
}
}
}
Run development server
yarn start