hasura / hasura/graphql-engine

Provide a way to execute some code or call a webhook when user connects/disconnects to Hasura graphql websocket endpoint

Open
#9,216 0 comments 1 reaction 0 assignees View on GitHub
k/enhancement t/product-platform
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Let's imagine I'm building a chat application.
And as a user, I want to see who is online and who is not.

And from a technical point of view to implement such a functional is needed a Websocket server and when some user connects we update the `is_online` column to TRUE and when he disconnects we update it in DB to FALSE.
At the moment to achieve that we have to build a `separate websocket server` and connect with it too, and that's because Hasura doesn't provide a way to exec some actions or call a webhook when a user connects to Hasura Websocket or disconnects.
I see this feature as something similar to what Hasura have in the Events tab. But this time the on-ws-connect/disconnect event should be triggered when someone connects or disconnect.
Thanks!

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Hasura's GraphQL WebSocket connection lifecycle and the existing Events tab webhook behavior. Define how connect and disconnect events should be exposed, including the event data and delivery semantics; done means users can configure callbacks for both lifecycle events without a separate WebSocket server.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.