graphql-python / graphene-django

Build powerful, efficient, and flexible GraphQL APIs with seamless Django integration.
http://docs.graphene-python.org/projects/django/en/latest/
MIT License
4.31k stars 769 forks source link

Support subscriptions #120

Open jason-curtis opened 7 years ago

jason-curtis commented 7 years ago

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!

BossGrand commented 7 years ago

This is being talked about here in graphene

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

eamigo86 commented 6 years ago

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

mvanlonden commented 5 years ago

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

mvanlonden commented 5 years ago

Reopening to add native support for subscriptions using channels

firaskafri commented 5 years ago

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

stale[bot] commented 5 years ago

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.

fkromer commented 4 years ago

@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.

Suor commented 4 years ago

So there is no advised way to do that?

Eraldo commented 4 years ago

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? 😊

ulgens commented 4 years ago

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

ulgens commented 4 years ago

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

jaydenwindle commented 4 years ago

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.

SmileyChris commented 4 years ago

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.

Eraldo commented 4 years ago

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

stale[bot] commented 4 years ago

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.

Eraldo commented 4 years ago

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

Ahtii commented 3 years ago

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.

Eraldo commented 2 years ago

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

procopio420 commented 1 year ago

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

prokher commented 1 year ago

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.