Skip to content

started on channels 2 updates (WIP) #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor the order to make moe sense
  • Loading branch information
colanconnon committed Feb 20, 2018
commit efabfc4623bb02c9fe28a18a891544bed417c539
4 changes: 2 additions & 2 deletions graphql_ws/django_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ class GraphQLSubscriptionConsumer(JsonWebsocketConsumer):

def connect(self):
self.accept()

def receive_json(self, content):
self.connection_context = DjangoChannelConnectionContext(self.send_json, self.close)
self.subscription_server = DjangoChannelSubscriptionServer(graphene_settings.SCHEMA)
self.subscription_server.on_open(self.connection_context)

def receive_json(self, content):
self.subscription_server.handle(content, self.connection_context)


Expand Down