Skip to content

Commit

Permalink
Fix some mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Feb 17, 2025
1 parent b7935f7 commit 8c6c0d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
10 changes: 3 additions & 7 deletions src/graphql/type/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,7 @@ def fields(self) -> GraphQLFieldMap:
)
return {
assert_name(name): (
value
if isinstance(value, GraphQLField)
else GraphQLField(value) # type: ignore
value if isinstance(value, GraphQLField) else GraphQLField(value)
)
for name, value in fields.items()
}
Expand Down Expand Up @@ -969,9 +967,7 @@ def fields(self) -> GraphQLFieldMap:
)
return {
assert_name(name): (
value
if isinstance(value, GraphQLField)
else GraphQLField(value) # type: ignore
value if isinstance(value, GraphQLField) else GraphQLField(value)
)
for name, value in fields.items()
}
Expand Down Expand Up @@ -1492,7 +1488,7 @@ def fields(self) -> GraphQLInputFieldMap:
assert_name(name): (
value
if isinstance(value, GraphQLInputField)
else GraphQLInputField(value) # type: ignore
else GraphQLInputField(value)
)
for name, value in fields.items()
}
Expand Down
10 changes: 6 additions & 4 deletions src/graphql/utilities/get_introspection_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ class IntrospectionSchema(MaybeWithDescription):
directives: List[IntrospectionDirective]


class IntrospectionQuery(TypedDict):
"""The root typed dictionary for schema introspections."""

__schema: IntrospectionSchema
# The root typed dictionary for schema introspections.
# Note: We don't use class syntax here since the key looks like a private attribute.
IntrospectionQuery = TypedDict(
"IntrospectionQuery",
{"__schema": IntrospectionSchema},
)
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ isolated_build = true

[gh-actions]
python =
3: py311
3: py313
3.6: py36
3.7: py37
3.8: py38
Expand Down Expand Up @@ -32,7 +32,7 @@ commands =
[testenv:mypy]
basepython = python3.12
deps =
mypy>=1.14,<2
mypy>=1.15,<2
pytest>=8.3,<9
commands =
mypy src tests
Expand Down

0 comments on commit 8c6c0d8

Please sign in to comment.