Skip to content

Commit

Permalink
Black applied.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander.prokhorov committed Jul 18, 2024
1 parent a07c578 commit 1ade107
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions channels_graphql_ws/graphql_ws_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ def __init__(self, *args, **kwargs):
self._graphql_ws_subprotocol = None

# Registry of active (subscribed) subscriptions.
self._subscriptions: Dict[
int, GraphqlWsConsumer._SubInf
] = {} # {'<sid>': '<SubInf>', ...}
self._subscriptions: Dict[int, GraphqlWsConsumer._SubInf] = (
{}
) # {'<sid>': '<SubInf>', ...}
self._sids_by_group = {} # {'<grp>': ['<sid0>', '<sid1>', ...], ...}

# Tasks which send notifications to clients indexed by an
Expand Down Expand Up @@ -913,9 +913,7 @@ async def consume_stream():
# Respond with general error response.
await self._send_gql_error(op_id, [ex])

async def _on_gql_subscribe__parse_query(
self, op_name: str, query: str
) -> Tuple[
async def _on_gql_subscribe__parse_query(self, op_name: str, query: str) -> Tuple[
Optional[graphql.DocumentNode],
Optional[graphql.OperationDefinitionNode],
Optional[Iterable[graphql.GraphQLError]],
Expand Down Expand Up @@ -1286,9 +1284,11 @@ async def _send_gql_ping(self):
"""Send the `ping`/`ka` message to the client."""
await self.send_json(
{
"type": "ping"
if self._graphql_ws_subprotocol == "graphql-transport-ws"
else "ka"
"type": (
"ping"
if self._graphql_ws_subprotocol == "graphql-transport-ws"
else "ka"
)
}
)

Expand Down Expand Up @@ -1326,9 +1326,11 @@ async def _send_gql_next(

await self.send_json(
{
"type": "next"
if self._graphql_ws_subprotocol == "graphql-transport-ws"
else "data",
"type": (
"next"
if self._graphql_ws_subprotocol == "graphql-transport-ws"
else "data"
),
"id": op_id,
"payload": {
"data": data,
Expand Down

0 comments on commit 1ade107

Please sign in to comment.