Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8c6c0d8

Browse files
committedFeb 17, 2025··
Fix some mypy issues
1 parent b7935f7 commit 8c6c0d8

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed
 

‎src/graphql/type/definition.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,7 @@ def fields(self) -> GraphQLFieldMap:
833833
)
834834
return {
835835
assert_name(name): (
836-
value
837-
if isinstance(value, GraphQLField)
838-
else GraphQLField(value) # type: ignore
836+
value if isinstance(value, GraphQLField) else GraphQLField(value)
839837
)
840838
for name, value in fields.items()
841839
}
@@ -969,9 +967,7 @@ def fields(self) -> GraphQLFieldMap:
969967
)
970968
return {
971969
assert_name(name): (
972-
value
973-
if isinstance(value, GraphQLField)
974-
else GraphQLField(value) # type: ignore
970+
value if isinstance(value, GraphQLField) else GraphQLField(value)
975971
)
976972
for name, value in fields.items()
977973
}
@@ -1492,7 +1488,7 @@ def fields(self) -> GraphQLInputFieldMap:
14921488
assert_name(name): (
14931489
value
14941490
if isinstance(value, GraphQLInputField)
1495-
else GraphQLInputField(value) # type: ignore
1491+
else GraphQLInputField(value)
14961492
)
14971493
for name, value in fields.items()
14981494
}

‎src/graphql/utilities/get_introspection_query.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ class IntrospectionSchema(MaybeWithDescription):
292292
directives: List[IntrospectionDirective]
293293

294294

295-
class IntrospectionQuery(TypedDict):
296-
"""The root typed dictionary for schema introspections."""
297-
298-
__schema: IntrospectionSchema
295+
# The root typed dictionary for schema introspections.
296+
# Note: We don't use class syntax here since the key looks like a private attribute.
297+
IntrospectionQuery = TypedDict(
298+
"IntrospectionQuery",
299+
{"__schema": IntrospectionSchema},
300+
)

‎tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ isolated_build = true
44

55
[gh-actions]
66
python =
7-
3: py311
7+
3: py313
88
3.6: py36
99
3.7: py37
1010
3.8: py38
@@ -32,7 +32,7 @@ commands =
3232
[testenv:mypy]
3333
basepython = python3.12
3434
deps =
35-
mypy>=1.14,<2
35+
mypy>=1.15,<2
3636
pytest>=8.3,<9
3737
commands =
3838
mypy src tests

0 commit comments

Comments
 (0)
Please sign in to comment.