Skip to content

Commit 1a5e2e6

Browse files
magicmarkclaude
andcommitted
Fix typing of TransportQueryError.errors from List[Any] to List[GraphQLError]
The `errors` attribute of `TransportQueryError` is populated from `ExecutionResult.errors`, which is typed as `list[GraphQLError] | None` in graphql-core. The type annotation should reflect this rather than using the overly broad `List[Any]`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 91b9355 commit 1a5e2e6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gql/transport/exceptions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Any, List, Optional
22

3+
from graphql import GraphQLError
4+
35

46
class TransportError(Exception):
57
"""Base class for all the Transport exceptions"""
@@ -34,15 +36,15 @@ class TransportQueryError(TransportError):
3436
"""
3537

3638
query_id: Optional[int]
37-
errors: Optional[List[Any]]
39+
errors: Optional[List[GraphQLError]]
3840
data: Optional[Any]
3941
extensions: Optional[Any]
4042

4143
def __init__(
4244
self,
4345
msg: str,
4446
query_id: Optional[int] = None,
45-
errors: Optional[List[Any]] = None,
47+
errors: Optional[List[GraphQLError]] = None,
4648
data: Optional[Any] = None,
4749
extensions: Optional[Any] = None,
4850
):

0 commit comments

Comments
 (0)