There has recently been an explosion of audio chat applications lately. Clubhouse, which allows a user to join on-going audio conversations or start a conversation that others can join, launched in April 2020 and has seen explosive growth. Other companies have also shipped audio chat products or announced they are working on them. Twitter launched Twitter spaces and many are following suit. Facebook, LinkedIn, Slack, Spotify are among companies that have confirmed they will be introducing live-audio features in the future.
In my previous GraphQL article, we learnt about creating a GraphQL API that implements queries and mutations. GraphQL, however, has a third type of operation called subscriptions.
Nowadays, most applications have a real-time component. For example, social media applications notify you in real time of new messages, or ride hailing apps stream the driver’s location in real time. GraphQL subscriptions allow a server to send real time updates to subscribed clients each time new data is available, usually via WebSocket.
In this tutorial, we will build a project in which the server pushes messages sent by other users to subscribed clients.
The only requirement to follow this tutorial is to have Python 3.6 or higher installed. If you don’t have it installed, get it here.
Create a Python virtual environment
We will install a few Python packages for our project. A virtual environment will come …
You have probably come across the term GraphQL but do you know what is it? Rest easy (pun not intended), as you will learn about it shortly.
GraphQL is a query language for APIs and a server-side runtime that allows clients to request only the data that they need from APIs. GraphQL is meant to be a more efficient and flexible alternative to REST.
GraphQL vs. REST
With REST, we model our API as resources, provide endpoints to access particular …
WhatsApp has become the defacto messaging application that most people use to keep in touch. Wouldn’t it be convenient to build a WhatsApp bot that receives your location and responds with an instant weather update?
See a sample interaction below:
- Python 3.6 or higher. If you don’t have it installed, get it here
- Twilio account: If you are new to Twilio, sign up for an account here.
- OpenWeather account: If you are new to OpenWeather, sign up for an account here.
- ngrok: a tool that allows us to expose local servers to the public internet. We will use it to create a public URL that Twilio can use to securely communicate with our …