This repository contains a basic system of services to facilitate the introduction of GraphQL concepts, patterns, and best practices used in the Candidate Graph.
⚠️ This is not production ready code: This is for demonstration purposes only and should never be deployed.
This tutorial assumes a basic understanding of Typescript and GraphQL principles.
Helpful tutorial links to get started with GraphQL:
This repository contains two APIs, one for GraphQL and another for the resource Music API.
To set up the GraphQL API, open a new terminal in this repository and follow the steps below:
- Navigate to the
graphql-api
folder
cd graphql-api
- Set up the dependencies
yarn
- Startup service
yarn start
Repeat this on another terminal for music-api
.
Service | Location |
---|---|
GraphQL API | localhost:4000 |
Music API | localhost:8001 |
To confirm the system has been instantiated correctly, you can visit the GraphQL Playground where you can explore the current schema and test an example query.
You will only be developing on the GraphQL API. nodemon
will automatically restart the application when file changes in the directory are detected.
Tests can be run using
yarn test
Feel free to change the mock data in music-api/src/mock-data.ts
if Taylor Swift and Blackpink aren't your cup of tea 😛.
- Custom scalar
- Custom enum
- Custom directive
- RESTDataSource caching -> hit music api with a put
- RESTDataSource batching