An API implemented using Apollo Server. It emulates an API for car rental.
- To run locally you will need node installed globally on your machine. You can use either
npm
or yarn as package managers. - To run the project image you will need Docker installed
- Clone down this repository
- Run
npm install
inside the main folder install the project dependencies innode modules
- Build and run the application with
npm run serve
- Clone down this repository
- On the main folder, run
docker-compose up
, this will build and run a docker image of the project using the dockerfile configurations.
To run the implemented tests, after installing the dependencies with npm install
, run npm test
on the main folder.
To see the GraphQL queries and run them on your own with Apollo Server:
localhost:8080/graphql
Send a requisition to localhost:8080/graphql
with method POST
using the following body example:
"query": "query {
cars {
brand
color
id
licensePlate
}
}"
Response example:
{
"data": {
"cars": [
{
"brand": "BMW",
"color": "red",
"id": 1,
"licensePlate": "BBBB"
}
]
}
}