Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rproenza86/simplerestapi-graphql-client

GraphQL server project built using Apollo Server and ExpressJS.
https://github.com/rproenza86/simplerestapi-graphql-client

apollo-server expressjs graphql integration-testing jest unit-testing

Last synced: about 6 hours ago
JSON representation

GraphQL server project built using Apollo Server and ExpressJS.

Awesome Lists containing this project

README

        

# simplerestapi-graphql-client

> GraphQL Workshop

This is service app to create a basic GraphQL server.

## Description

GraphQL server project built using Apollo Server and ExpressJS.

The service is using directives to enable security by checking user auth. Two data sources were created to support CRUDs ops.

The app is an orchestration of :

1. apollo-server
2. express
3. graphql
4. SimpleREST.com API

## API Requirements

1. Consumers of the service should be able of use the serve endpoint to:

- Execute mutation to increment a property favorite counter by 1.
- Fetching properties data from the SimplyRETS API and for each result, inject the “favorite counter” from MongoDB.
- We should be able to filter properties by city.

Example:
query {
properties(city: "San Francisco") {
listingId
favoriteCount // coming from MongoDB, everything else comes from SimplyRETS
listPrice
property {
area
bedrooms
}
address
disclaimer
}
}

2. Unit tests and/or integration tests support
> Added one test suite of each type. Added also un-implemented test cases to show other scenarios that need to be tested.

## How to Test

Use the [Insomnia requests collection](docs/serviceRequestsCollection/Insomnia_SimpleREST.json) exported on the `docs` directory
to test the service running locally.

### Tests setup

1. With latest Node LTS installed, run the following commands in order:

```sh
npm ci
npm run start:db
npm run start:app
```