- Authenticate with auth0 (see https://github.com/taddison/turnip-tracker.git)
- Store data in fauna (price, transactions)
- graphql - index to search by user
- prices endpoint returns prices for user
- Each user only sees their own turnips
- Create a database on fauna (https://dashboard.fauna.com/)
- Import the graphql schema file
schema.gql
- Create a new role (security -> manage roles)
- Grant CRUD on all three collections (Transaction, User, Price)
- Grant read on all five indexes (transactions, prices, users, price_user_by_user, transaction_user_by_user)
- Create a new key in the role
- Place this key in a
.env.local
file, with the name FAUNA_SECRET
. See .env.sample
for an example.
mutation CreatePrice {
createPrice(
data: {
user: { connect: 261564896538264084 }
weekStart: "2020-03-27"
isMorning: false
price: 101
}
) {
_id
}
}