This is a Next.js project bootstrapped with create-next-app
, using Apollo as GraphQL client to fetch data from a Hasura API.
git clone https://github.com/hubiwan/next-apollo-hasura.git
# remove .git and re-initialize
rm -rf .git
git init
yarn
# or
npm install
Set development environment variables:
cp .env.local.example .env.local
Set production environment variables (used for Hasura metadata and migration deployment):
cp .env.production.local.example .env.production.local
Don't forget to set other necessary production environment variables directly on respective platforms when deploying (e.g. on Vercel or Hasura)
# Apply metadata
hasura metadata apply --envfile ../.env.local
# Apply migration
hasura migrate apply --database-name default --envfile ../.env.local
# Reload metadata
hasura metadata reload --envfile ../.env.local
# Hasura GraphQL dev mode
cd hasura && docker-compose --env-file ../.env.local up -d && hasura console --envfile ../.env.local
# Next.js app dev mode
yarn dev
# or
npm run dev
cd hasura && docker-compose --env-file ../.env.local down