ruxo / gateway

Tutorial to learn base concepts of GraphQL and build a Gateway API using Hot Chocolate server supporting Query, Mutation, Subscription and Schema Stitching.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL Gateway

Tutorial to build a GraphQL Gateway API powered by Hot Chocolate server. How to work with Queries, Mutations, Subscriptions, and Schema Stitching. Use under the hood NoSQL databases such as Neo4j, MongoDB and Redis.

Workshop

Welcome to GraphQL Gateway API tutorial.

We recommend you to fork the repo and then start tutorial.

Tutorial

  • Folder /src contains all ready-to-use services.
  • Services gql, gw, and rest have a readme.md file with a setp-by-setp tutorial how to create it.
  • Explanation on how to build web-clients are not provided. You can use them just to run as is.
/src
  /gql-service # Apollo GraphQL Server connected to Neo4j Database
  /gw-service # Hot Chocolate GraphQL Gateway API
  /rest-service # .NET WebApi Swagger-based connected to MongoDB
  /web-clinet-list # React app for Phase 1
  /web-clinet-likes # React app for Phase 2
  docker-compose.yml # Can be used to build and run containers

We recommend you to take a quick overview of repository structure and then start Phase 1.

Phase 1: List of Tags

In first phase you will build a Hot Chocolate Gateway API connected to REST WebApi to manipulate list of Tags stored in MongoDB. You will learn how to resolve Query, Mutation and use Subscription.

  1. Create WebAPI service using MongoDB using /rest-service tutorial (Optional).
  2. Create GraphQL Gateway API using Hot Chocolate server using /gw-service/readme-phase1.md tutorial.
  3. Frontend project is ready to use from /web-client-list folder.

Expectations:

  • rest-service run as docker container.
  • gw-service run locally using cli or as a docker container.
  • web-client-list run locally using cli.

phase1

Phase 2: Friend Recommendations

Once Tags collection is working, now you will stitch your Gateway API schema with the schema of Apollo GraphQL server connected to Neo4j database.

  1. Create GraphQL server connected to Neo4j using /gql-service tutorial (Optional).
  2. Update GraphQL Gateway API using Hot Chocolate server using /gw-service/readme-phase2.md tutorial.
  3. Frontend project is ready to use from /web-client-likes folder.

Expectations:

  • gql-service run as docker container.
  • gw-service run locally using cli or as a docker container.
  • web-client-likes run locally using cli.

phase2

Tech Stack

  • Frontend
    • React / TypeScript
  • Backend
    • .NET / C#
    • REST WebApi / Swagger
    • Gateway API / GraphQL / Hot Chocolate
    • NodeJS / Apollo Server
  • NoSQL
    • Neo4j Graph Database
    • MongoDB
    • Redis

Prerequisites

"Good to have" VSCode extension
  1. .NET Extension Pack
  2. Auto-Using for C#
  3. Roslynator
  4. C#

Learning Resources

About

Tutorial to learn base concepts of GraphQL and build a Gateway API using Hot Chocolate server supporting Query, Mutation, Subscription and Schema Stitching.


Languages

Language:TypeScript 72.3%Language:C# 22.6%Language:HTML 2.2%Language:CSS 1.5%Language:JavaScript 0.8%Language:Dockerfile 0.6%