8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d240d4 commit 37f8eb2Copy full SHA for 37f8eb2
.github/workflows/test.yml
@@ -21,7 +21,7 @@ jobs:
21
- name: Install dependencies
22
run: |
23
python -m pip install --upgrade pip
24
- pip install "tox>=4.12,<5" "tox-gh-actions>=3.2,<4"
+ pip install "tox>=3.28,<5" "tox-gh-actions>=3.2,<4"
25
26
- name: Run unit tests with tox
27
run: tox
README.md
@@ -1,6 +1,6 @@
1
# GraphQL-core 3
2
3
-GraphQL-core 3 is a Python 3.7+ port of [GraphQL.js](https://github.com/graphql/graphql-js),
+GraphQL-core 3 is a Python 3.6+ port of [GraphQL.js](https://github.com/graphql/graphql-js),
4
the JavaScript reference implementation for [GraphQL](https://graphql.org/),
5
a query language for APIs created by Facebook.
6
@@ -203,7 +203,7 @@ Design goals for the GraphQL-core 3 library were:
203
204
Some restrictions (mostly in line with the design goals):
205
206
-* requires Python 3.7 or newer
+* requires Python 3.6 or newer (Python 3.7 and newer in latest version)
207
* does not support some already deprecated methods and options of GraphQL.js
208
* supports asynchronous operations only via async.io
209
(does not support the additional executors in GraphQL-core)
pyproject.toml
@@ -64,7 +64,7 @@ optional = true
64
65
[tool.poetry.group.lint.dependencies]
66
ruff = ">=0.2,<0.3"
67
-mypy = "1.3.0"
+mypy = "1.8.0"
68
bump2version = ">=1.0,<2"
69
70
[tool.poetry.group.doc]
src/graphql/execution/execute.py
@@ -2039,7 +2039,7 @@ def execute(
2039
raise GraphQLError(UNEXPECTED_MULTIPLE_PAYLOADS)
2040
2041
async def await_result() -> Any:
2042
- awaited_result = await result # type: ignore
+ awaited_result = await result
2043
if isinstance(awaited_result, ExecutionResult):
2044
return awaited_result
2045
return ExecutionResult(
@@ -2388,7 +2388,7 @@ def subscribe(
2388
return map_async_iterable(result, ensure_single_execution_result)
2389
2390
async def await_result() -> Union[AsyncIterator[ExecutionResult], ExecutionResult]:
2391
- result_or_iterable = await result # type: ignore
+ result_or_iterable = await result
2392
if isinstance(result_or_iterable, AsyncIterable):
2393
return map_async_iterable(
2394
result_or_iterable, ensure_single_execution_result
@@ -2496,9 +2496,7 @@ async def await_result() -> Any:
2496
awaited_result_or_stream = await result_or_stream # type: ignore
2497
if isinstance(awaited_result_or_stream, ExecutionResult):
2498
return awaited_result_or_stream
2499
- return context.map_source_to_response( # type: ignore
2500
- awaited_result_or_stream
2501
- )
+ return context.map_source_to_response(awaited_result_or_stream)
2502
2503
return await_result()
2504
src/graphql/type/definition.py
@@ -1055,7 +1055,7 @@ def __init__(
1055
isinstance(name, str) for name in values
1056
):
1057
try:
1058
- values = dict(values) # type: ignore
+ values = dict(values)
1059
except (TypeError, ValueError) as error:
1060
msg = (
1061
f"{name} values must be an Enum or a mapping"
src/graphql/utilities/strip_ignored_characters.py
@@ -11,7 +11,7 @@
11
12
13
def strip_ignored_characters(source: Union[str, Source]) -> str:
14
- """Strip characters that are ignored anyway.
+ '''Strip characters that are ignored anyway.
15
16
Strips characters that are not significant to the validity or execution
17
of a GraphQL document:
@@ -51,20 +51,20 @@ def strip_ignored_characters(source: Union[str, Source]) -> str:
51
52
SDL example::
53
54
- \"\"\"
+ """
55
Type description
56
57
type Foo {
58
59
Field description
60
61
bar: String
62
}
63
Becomes::
- \"\"\"Type description\"\"\" type Foo{\"\"\"Field description\"\"\" bar:String}
- """
+ """Type description""" type Foo{"""Field description""" bar:String}
+ '''
if not is_source(source):
source = Source(cast(str, source))
src/graphql/validation/validate.py
@@ -59,7 +59,7 @@ def validate(
errors: List[GraphQLError] = []
def on_error(error: GraphQLError) -> None:
- if len(errors) >= max_errors: # type: ignore
+ if len(errors) >= max_errors:
raise validation_aborted_error
errors.append(error)
tests/test_user_registry.py
@@ -492,13 +492,13 @@ async def mutate_users():
492
)
493
494
async def receive_one():
495
- async for result in subscription_one: # type: ignore # pragma: no cover
+ async for result in subscription_one: # pragma: no cover
496
received_one.append(result)
497
if len(received_one) == 3: # pragma: no cover else
498
break
499
500
async def receive_all():
501
- async for result in subscription_all: # type: ignore # pragma: no cover
+ async for result in subscription_all: # pragma: no cover
502
received_all.append(result)
503
if len(received_all) == 6: # pragma: no cover else
504
tests/type/test_definition.py
@@ -735,7 +735,7 @@ def defines_an_enum_type_with_a_description():
735
description = "nice enum"
736
enum_type = GraphQLEnumType(
737
"SomeEnum",
738
- {}, # type: ignore
+ {},
739
description=description,
740
741
assert enum_type.description is description
@@ -887,7 +887,7 @@ def accepts_an_enum_type_with_ast_node_and_extension_ast_nodes():
887
extension_ast_nodes = [EnumTypeExtensionNode()]
888
889
890
891
ast_node=ast_node,
892
extension_ast_nodes=extension_ast_nodes,
893
tox.ini
@@ -23,7 +23,7 @@ commands =
[testenv:mypy]
basepython = python3.11
deps =
- mypy==1.3.0
+ mypy==1.8.0
pytest>=7.3,<8
28
commands =
29
mypy src tests