When dev api is running (port 3000), npm run codegen
generates the types from exposed graphQL schema.
These generated types (src/generated/types.ts
) are used to type arguments of all resolvers.
Run postgres container
docker run --name devPostgres --env-file .env.dev -p 5432:5432 -d postgres
Install dependencies
npm i
Create tables
npm run db:migrate:dev
Seed tables
npm run db:seed:dev
Run the api
npm run start:dev
Access sandbox
localhost:3000
. You can play around and see documentation
npm run compose:dev
will use.env.dev
file. When hosting the api, we would runnpm run compose:prod
and copy.env
file on the server.- try the api:
- Access Apollo sandbox at
http://localhost:13000
- Import
postman_collection.json
in Postman to have prepared queries
- Access Apollo sandbox at