INNER CODE UNIT · Python
GraphqlWsClient
psevensas/DjangoChannelsGraphqlWs · channels_graphql_ws/client.py:34
class GraphqlWsClient:
"""A client for the GraphQL WebSocket server.
The client implements a WebSocket-based GraphQL protocol. It is the
same protocol as the server implemented by the `GraphqlWsConsumer`
class. See its docstring for details and for the protocol
description.
This class implements only the protocol itself. The implementation
of the message delivery extracted into the separate interface
`GraphqlWsTransport`. So it is possible to use this client with
different network frameworks, e.g. Tornado or AIOHTTP.
NOTE: The `receive` method retrieves the first response received by
backend, when used with subscriptions it may either return
subscription data or some query result. The response type must be
checked outside the client manually.