graphene-django icon indicating copy to clipboard operation
graphene-django copied to clipboard

Support subscriptions

Open jason-curtis opened this issue 8 years ago • 20 comments

Subscription support was added to graphene in graphql-python/graphene#35. It would be awesome to have it built in to graphene-django so that we can build real-time apps with it!

jason-curtis avatar Feb 23 '17 19:02 jason-curtis

This is being talked about here in graphene

https://github.com/graphql-python/graphene/issues/430

BossGrand avatar Jun 28 '17 19:06 BossGrand

Hi @thatneat, please, visit this module might interest you to use subscriptions on graphene-django

eamigo86 avatar Dec 05 '17 20:12 eamigo86

Subscriptions added in v2 https://github.com/graphql-python/graphene/releases/tag/v2.0.0

mvanlonden avatar Mar 30 '19 23:03 mvanlonden

Reopening to add native support for subscriptions using channels

mvanlonden avatar Apr 01 '19 15:04 mvanlonden

@eamigo86 what are your thoughts regarding adding subscriptions to the django-graphene repo?

firaskafri avatar Apr 02 '19 19:04 firaskafri

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 11 '19 10:06 stale[bot]

@firaskafri @eamigo86 The package graphene-subscriptions has great integration of GraphQL subscriptions with Django models. Probably it would be valueable to get in contact with the lead dev for possible integration as well.

fkromer avatar Jan 29 '20 09:01 fkromer

So there is no advised way to do that?

Suor avatar Apr 16 '20 17:04 Suor

I am also a bit hesitant to use graphene-subscriptions since the last commit was nearly half a year ago.

Are subscriptions on the roadmap? Is there such a thing? 😊

Eraldo avatar May 10 '20 20:05 Eraldo

@jkimbo Around 3.2 or 3.3 maybe? I can allocate some time for this.

ulgens avatar May 11 '20 05:05 ulgens

I'm reopening the issue btw. This is a missing feature in graphene-django side, that's for certain.

ulgens avatar May 11 '20 05:05 ulgens

Hi all! Author of graphene-subscriptions here 😊

It would be awesome to see subscriptions support added to graphene-django. I'm happy to submit a PR with my subscriptions implementation if there is interest in integrating it into this library.

One challenge with implementing subscriptions in graphene-django v2 right now is that you need to stitch together the async-based pattern that Django Channels uses with the Observable-based pattern used in graphene. This is what graphene-subscriptions does currently.

(Side note: @Eraldo I can definitely understand your concern there! Rest assured that I'm still actively supporting it (I'm hoping to ship graphene-subscriptions v2 very soon). Feel free to open an issue or DM me if you have any questions!)

Once graphene-django v3 ships with support for async resolvers, implementing built-in support for subscriptions will be much simpler and the implementation will be much cleaner.

@jkimbo I would love to help ship subscriptions support for graphene-django if that's something you and the team would be interested in supporting natively.

jaydenwindle avatar May 12 '20 14:05 jaydenwindle

Also, if you're looking for an alternative, I'm the author of the graphql-ws branch handling django channels 2 subscriptions. Hopefully will have that merged to master soon (but actively using the branch in a pre-production environment successfully).

Seems like there's gaining traction on multiple solutions that are getting this done. Also happy to help work on (or consult on) a built in solution if it fits.

SmileyChris avatar Jun 01 '20 10:06 SmileyChris

This seems to be another option that I want to include for completion's sake: https://github.com/datadvance/DjangoChannelsGraphqlWs

Eraldo avatar Jun 16 '20 23:06 Eraldo

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Aug 27 '20 00:08 stale[bot]

Any updates? hopeful-eyes Any clue which 3rd party library is more/less likely to make it into graphene-django at some point?

Eraldo avatar Sep 21 '20 14:09 Eraldo

Anyone please help i am stuck in creating custom view (instead of GraphiQL) for subscription i am using @jaydenwindle 's graphene-subscription](https://pypi.org/project/graphene-subscriptions/) package here is the link to my problem.

Ahtii avatar Jan 29 '21 15:01 Ahtii

It has been over a year and a half since the last comment. sigh

Eraldo avatar Jul 19 '22 21:07 Eraldo

all available libraries that I found has a lot of dependency problem with newer graphene versions :/ and implementing it by hand is being painful

procopio420 avatar Apr 25 '23 23:04 procopio420

We just published a huge update to DjangoChannelsGraphqlWs to support latest Django, Graphene & GraphQL-core. We still be happy to see subscriptions natively supported in Graphene & GraphQL-core, but until they are not there we stick to our own implementation, e.g. to DjangoChannelsGraphqlWs.

prokher avatar Apr 27 '23 21:04 prokher