jaydenwindle / graphene-subscriptions

A plug-and-play GraphQL subscription implementation for Graphene + Django built using Django Channels.
MIT License
116 stars 15 forks source link

Add ASGI implementation #5

Open jaydenwindle opened 4 years ago

jaydenwindle commented 4 years ago

Since Django 3.0 supports ASGI out of the box, this library doesn't necessarily need to rely on Django Channels as a dependency for newer Django projects. Instead, we could create a custom ASGI application, and use it to handle GraphQL websocket connections.

We would still need a pub/sub layer, but could use aioredis directly. This would make the code much easier to understand, since sending data to the client and responding to pub/sub events could be decoupled.

Some thoughts on implementing a custom websocket ASGI app for Django: https://jaydenwindle.com/writing/django-websockets-zero-dependencies/

levinotik commented 4 years ago

Nice Jayden! Will check out the post a bit later, but this makes perfect sense!