NestJS + Graphql Apollo Federation + Websocket + Microservices + React + Proxies Forward
- The Problems
- Graphql Apollo Federation old version doesn't support websocket
- Different manipulation of execution context types: http (like express), graphql (graphql apollo), rpc (websocket)
- The Solution
- Setup another instance of Graphql Module for websocket
- The setup
- Graphql Apollo Federation Gateway
- Authentication Graphql Endpoint
- Chatter Graphql Endpoint
- SetupProxies for React Front End App
- Guard types: JWT or GQL
- Graphql Apollo Federation Gateway
- Thinking
- Use cookies to store JWT Token
- Use only http authorization header only (HTTP.headers.authorization: Bearer akasd123a.asd13adkhjhgnsdfi4f.jweasdytn
- How to debug microservices effectively?
Hôm nay lười quá vì mới solve một số vấn đề WSL2, Docker, Nodejs App không expose được port 3000 để đọc trên local dev máy mình đang vừa học vừa dev. Vì thế mình để tạm một số solution cho bạn nào cần và tìm hiểu thêm nhé.