@@ -189,15 +189,15 @@ def assert_type(type_: Any) -> GraphQLType:
189
189
190
190
# These types wrap and modify other types
191
191
192
- GT = TypeVar ("GT " , bound = GraphQLType , covariant = True ) # noqa: PLC0105
192
+ GT_co = TypeVar ("GT_co " , bound = GraphQLType , covariant = True )
193
193
194
194
195
- class GraphQLWrappingType (GraphQLType , Generic [GT ]):
195
+ class GraphQLWrappingType (GraphQLType , Generic [GT_co ]):
196
196
"""Base class for all GraphQL wrapping types"""
197
197
198
- of_type : GT
198
+ of_type : GT_co
199
199
200
- def __init__ (self , type_ : GT ) -> None :
200
+ def __init__ (self , type_ : GT_co ) -> None :
201
201
self .of_type = type_
202
202
203
203
def __repr__ (self ) -> str :
@@ -255,7 +255,7 @@ def _get_instance(cls, name: str, args: tuple) -> GraphQLNamedType:
255
255
try :
256
256
return cls .reserved_types [name ]
257
257
except KeyError :
258
- return cls (** dict (args ))
258
+ return cls (** dict (args )) # pyright: ignore
259
259
260
260
def __init__ (
261
261
self ,
@@ -429,8 +429,8 @@ def parse_literal(
429
429
def to_kwargs (self ) -> GraphQLScalarTypeKwargs :
430
430
"""Get corresponding arguments."""
431
431
# noinspection PyArgumentList
432
- return GraphQLScalarTypeKwargs ( # type: ignore
433
- super ().to_kwargs (),
432
+ return GraphQLScalarTypeKwargs (
433
+ super ().to_kwargs (), # type: ignore
434
434
serialize = None
435
435
if self .serialize is GraphQLScalarType .serialize
436
436
else self .serialize ,
@@ -552,11 +552,11 @@ def __copy__(self) -> GraphQLField: # pragma: no cover
552
552
return self .__class__ (** self .to_kwargs ())
553
553
554
554
555
- TContext = TypeVar ("TContext" )
555
+ TContext = TypeVar ("TContext" ) # pylint: disable=invalid-name
556
556
557
557
try :
558
558
559
- class GraphQLResolveInfo (NamedTuple , Generic [TContext ]):
559
+ class GraphQLResolveInfo (NamedTuple , Generic [TContext ]): # pyright: ignore
560
560
"""Collection of information passed to the resolvers.
561
561
562
562
This is always passed as the first argument to the resolvers.
@@ -768,8 +768,8 @@ def __init__(
768
768
def to_kwargs (self ) -> GraphQLObjectTypeKwargs :
769
769
"""Get corresponding arguments."""
770
770
# noinspection PyArgumentList
771
- return GraphQLObjectTypeKwargs ( # type: ignore
772
- super ().to_kwargs (),
771
+ return GraphQLObjectTypeKwargs (
772
+ super ().to_kwargs (), # type: ignore
773
773
fields = self .fields .copy (),
774
774
interfaces = self .interfaces ,
775
775
is_type_of = self .is_type_of ,
@@ -873,8 +873,8 @@ def __init__(
873
873
def to_kwargs (self ) -> GraphQLInterfaceTypeKwargs :
874
874
"""Get corresponding arguments."""
875
875
# noinspection PyArgumentList
876
- return GraphQLInterfaceTypeKwargs ( # type: ignore
877
- super ().to_kwargs (),
876
+ return GraphQLInterfaceTypeKwargs (
877
+ super ().to_kwargs (), # type: ignore
878
878
fields = self .fields .copy (),
879
879
interfaces = self .interfaces ,
880
880
resolve_type = self .resolve_type ,
@@ -978,8 +978,10 @@ def __init__(
978
978
def to_kwargs (self ) -> GraphQLUnionTypeKwargs :
979
979
"""Get corresponding arguments."""
980
980
# noinspection PyArgumentList
981
- return GraphQLUnionTypeKwargs ( # type: ignore
982
- super ().to_kwargs (), types = self .types , resolve_type = self .resolve_type
981
+ return GraphQLUnionTypeKwargs (
982
+ super ().to_kwargs (), # type: ignore
983
+ types = self .types ,
984
+ resolve_type = self .resolve_type ,
983
985
)
984
986
985
987
def __copy__ (self ) -> GraphQLUnionType : # pragma: no cover
@@ -1082,7 +1084,7 @@ def __init__(
1082
1084
isinstance (name , str ) for name in values
1083
1085
):
1084
1086
try :
1085
- values = dict (values )
1087
+ values = dict (values ) # pyright: ignore
1086
1088
except (TypeError , ValueError ) as error :
1087
1089
msg = (
1088
1090
f"{ name } values must be an Enum or a mapping"
@@ -1107,8 +1109,9 @@ def __init__(
1107
1109
def to_kwargs (self ) -> GraphQLEnumTypeKwargs :
1108
1110
"""Get corresponding arguments."""
1109
1111
# noinspection PyArgumentList
1110
- return GraphQLEnumTypeKwargs ( # type: ignore
1111
- super ().to_kwargs (), values = self .values .copy ()
1112
+ return GraphQLEnumTypeKwargs (
1113
+ super ().to_kwargs (), # type: ignore
1114
+ values = self .values .copy (),
1112
1115
)
1113
1116
1114
1117
def __copy__ (self ) -> GraphQLEnumType : # pragma: no cover
@@ -1331,8 +1334,8 @@ def out_type(value: dict[str, Any]) -> Any:
1331
1334
def to_kwargs (self ) -> GraphQLInputObjectTypeKwargs :
1332
1335
"""Get corresponding arguments."""
1333
1336
# noinspection PyArgumentList
1334
- return GraphQLInputObjectTypeKwargs ( # type: ignore
1335
- super ().to_kwargs (),
1337
+ return GraphQLInputObjectTypeKwargs (
1338
+ super ().to_kwargs (), # type: ignore
1336
1339
fields = self .fields .copy (),
1337
1340
out_type = None
1338
1341
if self .out_type is GraphQLInputObjectType .out_type
@@ -1448,7 +1451,7 @@ def is_required_input_field(field: GraphQLInputField) -> bool:
1448
1451
# Wrapper types
1449
1452
1450
1453
1451
- class GraphQLList (GraphQLWrappingType [GT ]):
1454
+ class GraphQLList (GraphQLWrappingType [GT_co ]):
1452
1455
"""List Type Wrapper
1453
1456
1454
1457
A list is a wrapping type which points to another type. Lists are often created
@@ -1467,7 +1470,7 @@ def fields(self):
1467
1470
}
1468
1471
"""
1469
1472
1470
- def __init__ (self , type_ : GT ) -> None :
1473
+ def __init__ (self , type_ : GT_co ) -> None :
1471
1474
super ().__init__ (type_ = type_ )
1472
1475
1473
1476
def __str__ (self ) -> str :
@@ -1487,10 +1490,10 @@ def assert_list_type(type_: Any) -> GraphQLList:
1487
1490
return type_
1488
1491
1489
1492
1490
- GNT = TypeVar ("GNT " , bound = "GraphQLNullableType" , covariant = True ) # noqa: PLC0105
1493
+ GNT_co = TypeVar ("GNT_co " , bound = "GraphQLNullableType" , covariant = True )
1491
1494
1492
1495
1493
- class GraphQLNonNull (GraphQLWrappingType [GNT ]):
1496
+ class GraphQLNonNull (GraphQLWrappingType [GNT_co ]):
1494
1497
"""Non-Null Type Wrapper
1495
1498
1496
1499
A non-null is a wrapping type which points to another type. Non-null types enforce
@@ -1510,7 +1513,7 @@ class RowType(GraphQLObjectType):
1510
1513
Note: the enforcement of non-nullability occurs within the executor.
1511
1514
"""
1512
1515
1513
- def __init__ (self , type_ : GNT ) -> None :
1516
+ def __init__ (self , type_ : GNT_co ) -> None :
1514
1517
super ().__init__ (type_ = type_ )
1515
1518
1516
1519
def __str__ (self ) -> str :
0 commit comments