From 5e1e5e0eb204442a2ebaabf7941d9b2e056ff7a1 Mon Sep 17 00:00:00 2001 From: Jonathan Ehwald Date: Mon, 1 Jan 2024 17:17:15 +0100 Subject: [PATCH] Fix TypeAlias prior to 3.10 --- aiogqlc/types.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/aiogqlc/types.py b/aiogqlc/types.py index c794767..9076650 100644 --- a/aiogqlc/types.py +++ b/aiogqlc/types.py @@ -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, @@ -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, @@ -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): @@ -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, @@ -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, ]