Base URL: https://koajs-graphql.herokuapp.com/
Inside the project folder, run the command yarn or npm i for dependencies to be installed.
Run command cp .env.example .env.
NOTE: if you want to run the app without a docker container, make sure you have MongoDB installed in your machine or put the mongo database remote url in .env file.
At the end of this installation, inside the project folder run the command yarn dev or npm run dev for development environment so that API is executed.
Or run the command yarn start or npm run start for production environment to run a pm2 instance of application.
First of all, make sure you have Docker and Docker Compose installed and running on your after that, inside the application folder, enter the terminal and execute the command docker-compose up and with that the application should be running and you can proceed to the next step. NOTE: the URL has been configured to be the same as it would be called if you were not running in a container. URL http://localhost:3333
For this you can use some software that tests Http requests, I recommend using Postman or Insomnia
Make your url with the GraphQL common query.
ex1: {host}/graphql/users?query={user(id:"5ec6e5e8ed00d82ee7574647"){name}}
ex2: {host}/graphql/users?query={users{_id,name}}
The tests will be running with Jest
Use the following command to run tests: yarn test or npm run test