Before we start we need to ask a few questions.

  • Why do we use Asyncio?
  • Where do we use asyncio?
  • How do we use asyncio?

1. Why do we use Aysncio?

Python has been around for decades in the synchronous world. You call functions directly and everything gets processed as it’s written on the screen. Your only built-in option for running code in parallel in the same process is threads. When it comes to building web servers with python, this doesn't work because web servers should deal with many requests coming from different clients and servers should deal with these requests parallelly (asynchronously). Hence synchronous way…

A reverse proxy server is a type of proxy server that typically sits behind the firewall in a private network and directs client requests to the appropriate backend server. A reverse proxy provides an additional level of abstraction and control to ensure the smooth flow of network traffic between clients and servers.

Why do we need to do this?

  • Assume you are running multiple servers on different ports on your localhost.
  • So every time when you wanna make a call to the server it's localhost:3000/api, localhost:3001/api, and so on.
  • We can see this can be difficult when you have multiple…

Being a developer it’s always cool to explore new libraries and technology.

Being fed up with REST API’s, I moved to GraphQL last year. In simple words, GraphQL is not a 100% solution for every endpoint. When it comes to webhooks, simple public routes REST API’s suits better.

So the purpose of this post is to show how to code a simple graphql subscription in typescript.

Here we’ll be using well known graphql library Apollo Graphql. For typescript compatibility, we’ll be using type-graphql.

Okay now let’s take a look at how subscription work in brief.

🍺 ➡️ 🧑‍💻

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store