Django Channels based WebSocket GraphQL server with Graphene-like subscriptions
MIT License
Bot releases are hidden (Show)
info.context
in resolvers) lifetime has changed. It is now an object-like wrapper around Channels scope typically available as self.scope
in the Channels consumers. So you can access Channels scope as info.context
. Modifications made in info.context
are stored in the Channels scope, so they are persisted as long as WebSocket connection lives. You can work with info.context
both as with dict
or as with SimpleNamespace
.Published by prokher about 5 years ago
GraphqlWsConsumer.middleware
setting.scope
is now stored in info.context.scope
as dict
. (Previously info.context
was a copy of scope
wrapped into the types.SimpleNamespace
). The thing is the GraphQL info.context
and Channels scope
are different things. The info.context
is a storage for a single GraphQL operation, while scope
is a storage for the whole WebSocket connection. For example now use info.context.scope["user"]
to get access to the Django user model.GraphqlWsClient
transport timeout increased 5->60 seconds.poetry.lock
file