Releases: datadvance/DjangoChannelsGraphqlWs
Releases · datadvance/DjangoChannelsGraphqlWs
v0.4.0
- Context (
info.context
in resolvers) lifetime has changed. It is now an object-like wrapper around Channels scope typically available asself.scope
in the Channels consumers. So you can access Channels scope asinfo.context
. Modifications made ininfo.context
are stored in the Channels scope, so they are persisted as long as WebSocket connection lives. You can work withinfo.context
both as withdict
or as withSimpleNamespace
.
v0.3.0
- Support for GraphQL middleware, look at the
GraphqlWsConsumer.middleware
setting. - Example reworked to illustrate how to authenticate clients.
- Channels
scope
is now stored ininfo.context.scope
asdict
. (Previouslyinfo.context
was a copy ofscope
wrapped into thetypes.SimpleNamespace
). The thing is the GraphQLinfo.context
and Channelsscope
are different things. Theinfo.context
is a storage for a single GraphQL operation, whilescope
is a storage for the whole WebSocket connection. For example now useinfo.context.scope["user"]
to get access to the Django user model.