Skip to content

Commit

Permalink
fix mypy.
Browse files Browse the repository at this point in the history
  • Loading branch information
nrbnlulu committed Feb 21, 2023
1 parent 79faea8 commit 16015df
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import asyncio
from abc import ABC, abstractmethod
from contextlib import suppress
from typing import TYPE_CHECKING, Any, AsyncGenerator, Callable, Dict, List, Optional
from typing import TYPE_CHECKING, Any, AsyncIterator, Callable, Dict, List, Optional

from graphql import GraphQLError, GraphQLSyntaxError, parse
from graphql.error.graphql_error import format_error as format_graphql_error
Expand All @@ -29,9 +29,11 @@
from datetime import timedelta

from strawberry.schema import Schema
from strawberry.schema.subscribe import Subscription
from strawberry.subscriptions.protocols.graphql_transport_ws.types import (
GraphQLTransportMessage,
)
from strawberry.types.execution import ExecutionResult


class BaseGraphQLTransportWSHandler(ABC):
Expand All @@ -47,7 +49,7 @@ def __init__(
self.connection_init_timeout_task: Optional[asyncio.Task] = None
self.connection_init_received = False
self.connection_acknowledged = False
self.subscriptions: Dict[str, AsyncGenerator] = {}
self.subscriptions: Dict[str, Subscription] = {}
self.tasks: Dict[str, asyncio.Task] = {}
self.completed_tasks: List[asyncio.Task] = []
self.connection_params: Optional[Dict[str, Any]] = None
Expand Down Expand Up @@ -220,7 +222,7 @@ async def get_result_source():
)

async def operation_task(
self, result_source: AsyncGenerator, operation_id: str
self, result_source: AsyncIterator[ExecutionResult], operation_id: str
) -> None:
"""
Operation task top level method. Cleans up and de-registers the operation
Expand Down Expand Up @@ -252,7 +254,7 @@ async def operation_task(

async def handle_async_results(
self,
result_source: AsyncGenerator,
result_source: AsyncIterator[ExecutionResult],
operation_id: str,
) -> None:
try:
Expand Down

0 comments on commit 16015df

Please sign in to comment.