Skip to content

Commit

Permalink
Fix TypeAlias prior to 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorJohn committed Jan 1, 2024
1 parent 3c72848 commit 5e1e5e0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions aiogqlc/types.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import typing
from io import IOBase

from typing_extensions import NotRequired, Required
from typing_extensions import NotRequired, Required, TypeAlias

VariableValue: typing.TypeAlias = typing.Union[
VariableValue: TypeAlias = typing.Union[
str,
int,
None,
Expand All @@ -13,11 +13,11 @@
typing.Dict[str, "VariableValue"],
]

Variables: typing.TypeAlias = typing.Dict[str, VariableValue]
Variables: TypeAlias = typing.Dict[str, VariableValue]

FilesToPathsMapping: typing.TypeAlias = typing.Dict[IOBase, typing.List[str]]
FilesToPathsMapping: TypeAlias = typing.Dict[IOBase, typing.List[str]]

ConnectionInitParamValue: typing.TypeAlias = typing.Union[
ConnectionInitParamValue: TypeAlias = typing.Union[
None,
str,
int,
Expand All @@ -26,7 +26,7 @@
typing.Dict[str, "ConnectionInitParamValue"],
]

ConnectionInitParams: typing.TypeAlias = typing.Dict[str, ConnectionInitParamValue]
ConnectionInitParams: TypeAlias = typing.Dict[str, ConnectionInitParamValue]


class Payload(typing.TypedDict):
Expand Down Expand Up @@ -58,7 +58,7 @@ class GraphQLWSConnectionTerminateMessage(typing.TypedDict):
type: typing.Literal["connection_terminate"]


GraphQLWSClientOperationMessage: typing.TypeAlias = typing.Union[
GraphQLWSClientOperationMessage: TypeAlias = typing.Union[
GraphQLWSConnectionInitMessage,
GraphQLWSStartMessage,
GraphQLWSStopMessage,
Expand Down Expand Up @@ -113,19 +113,19 @@ class GraphQLWSConnectionKeepAliveMesssage(typing.TypedDict, total=True):
type: typing.Literal["ka"]


GraphQLWSServerConnectionOperationMessage: typing.TypeAlias = typing.Union[
GraphQLWSServerConnectionOperationMessage: TypeAlias = typing.Union[
GraphQLWSConnectionErrorMessage,
GraphQLWSConnectionAckMessage,
GraphQLWSConnectionKeepAliveMesssage,
]

GraphQLWSServerExecutionOperationMessage: typing.TypeAlias = typing.Union[
GraphQLWSServerExecutionOperationMessage: TypeAlias = typing.Union[
GraphQLWSDataMessage,
GraphQLWSErrorMessage,
GraphQLWSCompleteMessage,
]

GraphQLWSServerOperationMessage: typing.TypeAlias = typing.Union[
GraphQLWSServerOperationMessage: TypeAlias = typing.Union[
GraphQLWSServerConnectionOperationMessage,
GraphQLWSServerExecutionOperationMessage,
]

0 comments on commit 5e1e5e0

Please sign in to comment.