DjangoChannelsGraphqlWs

Django Channels based WebSocket GraphQL server with Graphene-like subscriptions

MIT License

Downloads
14.9K
Stars
280
Committers
13

Bot releases are hidden (Show)

DjangoChannelsGraphqlWs -

Published by prokher about 5 years ago

  • Context (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.
DjangoChannelsGraphqlWs - v0.3.0

Published by prokher about 5 years ago

  • Support for GraphQL middleware, look at the GraphqlWsConsumer.middleware setting.
  • Example reworked to illustrate how to authenticate clients.
  • Channels 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.
DjangoChannelsGraphqlWs -

Published by prokher about 5 years ago

  • Changelog eventually added.
  • GraphqlWsClient transport timeout increased 5->60 seconds.
  • Dependency problem fixed, version numbers frozen in poetry.lock file
    for non-development dependencies.
  • Tests which failed occasionally due to wrong DB misconfiguration.