Install packages using yarn.
yarn install
Create a postgres docker image by running the following command in terminal:
docker run -d --name nimdb_postgres -e "POSTGRES_PASSWORD=password" -e "POSTGRES_USER=nimdb" -e "POSTGRES_DB=nimdb" -p 54320:5432 postgres
docker container start nimdb_postgres (after docker restart)
Run migrations and seed database with knex:
cd server
yarn knex migrate:latest
yarn knex seed:run
Start a dev server in the root directory
yarn dev
- Create a Query|Mutation function in new .js file in src/graphql/[Query|Mutation]
- Import new function in
server/src/graphql/[Query|Mutation]/index.js
- Add the new function to the schema in
server/src/graphql/schema.graphql
- Test the Query|Mutation at http://localhost:4000/graphql/playground
- Save the query in
client/src/graphql/[queries|mutations]/exampleOperation.graphql
- Run the gql-gen code generator (automatic while watching with
yarn dev
) - Import from
../../graphql
the methods made available via the codegen, e.g.useExampleOperationQuery
|Mutation
NIMDB uses Cypress for end-to-end testing. Start up Cypress running the following command:
yarn run cypress open