strawberry-graphql 0.276.0.dev1752831589__py3-none-any.whl → 0.276.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- strawberry/__init__.py +0 -2
- strawberry/annotation.py +0 -7
- strawberry/cli/__init__.py +6 -6
- strawberry/experimental/pydantic/object_type.py +2 -2
- strawberry/extensions/directives.py +2 -6
- strawberry/extensions/mask_errors.py +10 -23
- strawberry/http/__init__.py +12 -22
- strawberry/http/async_base_view.py +12 -81
- strawberry/http/sync_base_view.py +8 -1
- strawberry/printer/printer.py +2 -10
- strawberry/relay/fields.py +5 -0
- strawberry/relay/types.py +1 -1
- strawberry/schema/config.py +0 -1
- strawberry/schema/name_converter.py +3 -2
- strawberry/schema/schema.py +25 -58
- strawberry/schema/schema_converter.py +62 -36
- strawberry/static/graphiql.html +5 -5
- strawberry/types/execution.py +1 -1
- {strawberry_graphql-0.276.0.dev1752831589.dist-info → strawberry_graphql-0.276.1.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.276.0.dev1752831589.dist-info → strawberry_graphql-0.276.1.dist-info}/RECORD +23 -25
- strawberry/schema/_graphql_core.py +0 -53
- strawberry/streamable.py +0 -36
- {strawberry_graphql-0.276.0.dev1752831589.dist-info → strawberry_graphql-0.276.1.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.276.0.dev1752831589.dist-info → strawberry_graphql-0.276.1.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.276.0.dev1752831589.dist-info → strawberry_graphql-0.276.1.dist-info}/entry_points.txt +0 -0
strawberry/__init__.py
CHANGED
@@ -11,7 +11,6 @@ from .permission import BasePermission
|
|
11
11
|
from .scalars import ID
|
12
12
|
from .schema import Schema
|
13
13
|
from .schema_directive import schema_directive
|
14
|
-
from .streamable import Streamable
|
15
14
|
from .types.arguments import argument
|
16
15
|
from .types.auto import auto
|
17
16
|
from .types.cast import cast
|
@@ -38,7 +37,6 @@ __all__ = [
|
|
38
37
|
"Private",
|
39
38
|
"Schema",
|
40
39
|
"Some",
|
41
|
-
"Streamable",
|
42
40
|
"argument",
|
43
41
|
"asdict",
|
44
42
|
"auto",
|
strawberry/annotation.py
CHANGED
@@ -17,7 +17,6 @@ from typing import (
|
|
17
17
|
)
|
18
18
|
from typing_extensions import Self, get_args, get_origin
|
19
19
|
|
20
|
-
from strawberry.streamable import StrawberryStreamable
|
21
20
|
from strawberry.types.base import (
|
22
21
|
StrawberryList,
|
23
22
|
StrawberryMaybe,
|
@@ -144,8 +143,6 @@ class StrawberryAnnotation:
|
|
144
143
|
|
145
144
|
if self._is_lazy_type(evaled_type):
|
146
145
|
return evaled_type
|
147
|
-
if self._is_streamable(evaled_type, args):
|
148
|
-
return self.create_list(list[evaled_type]) # type: ignore[valid-type]
|
149
146
|
if self._is_list(evaled_type):
|
150
147
|
return self.create_list(evaled_type)
|
151
148
|
if self._is_maybe(evaled_type):
|
@@ -335,10 +332,6 @@ class StrawberryAnnotation:
|
|
335
332
|
def _is_maybe(cls, annotation: Any) -> bool:
|
336
333
|
return _annotation_is_maybe(annotation)
|
337
334
|
|
338
|
-
@classmethod
|
339
|
-
def _is_streamable(cls, annotation: Any, args: list[Any]) -> bool:
|
340
|
-
return any(isinstance(arg, StrawberryStreamable) for arg in args)
|
341
|
-
|
342
335
|
@classmethod
|
343
336
|
def _is_strawberry_type(cls, evaled_type: Any) -> bool:
|
344
337
|
# Prevent import cycles
|
strawberry/cli/__init__.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
try:
|
2
2
|
from .app import app
|
3
|
-
from .commands.codegen import codegen as codegen
|
4
|
-
from .commands.export_schema import export_schema as export_schema
|
3
|
+
from .commands.codegen import codegen as codegen
|
4
|
+
from .commands.export_schema import export_schema as export_schema
|
5
5
|
from .commands.locate_definition import (
|
6
|
-
locate_definition as locate_definition,
|
6
|
+
locate_definition as locate_definition,
|
7
7
|
)
|
8
8
|
from .commands.schema_codegen import (
|
9
|
-
schema_codegen as schema_codegen,
|
9
|
+
schema_codegen as schema_codegen,
|
10
10
|
)
|
11
|
-
from .commands.server import server as server
|
12
|
-
from .commands.upgrade import upgrade as upgrade
|
11
|
+
from .commands.server import server as server
|
12
|
+
from .commands.upgrade import upgrade as upgrade
|
13
13
|
|
14
14
|
def run() -> None:
|
15
15
|
app()
|
@@ -116,7 +116,7 @@ if TYPE_CHECKING:
|
|
116
116
|
)
|
117
117
|
|
118
118
|
|
119
|
-
def type(
|
119
|
+
def type( # noqa: PLR0915
|
120
120
|
model: builtins.type[PydanticModel],
|
121
121
|
*,
|
122
122
|
fields: Optional[list[str]] = None,
|
@@ -129,7 +129,7 @@ def type(
|
|
129
129
|
include_computed: bool = False,
|
130
130
|
use_pydantic_alias: bool = True,
|
131
131
|
) -> Callable[..., builtins.type[StrawberryTypeFromPydantic[PydanticModel]]]:
|
132
|
-
def wrap(cls: Any) -> builtins.type[StrawberryTypeFromPydantic[PydanticModel]]:
|
132
|
+
def wrap(cls: Any) -> builtins.type[StrawberryTypeFromPydantic[PydanticModel]]: # noqa: PLR0915
|
133
133
|
compat = PydanticCompat.from_model(model)
|
134
134
|
model_fields = compat.get_model_fields(model, include_computed=include_computed)
|
135
135
|
original_fields_set = set(fields) if fields else set()
|
@@ -29,9 +29,7 @@ class DirectivesExtension(SchemaExtension):
|
|
29
29
|
) -> AwaitableOrValue[Any]:
|
30
30
|
value = await await_maybe(_next(root, info, *args, **kwargs))
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
for directive in nodes[0].directives:
|
32
|
+
for directive in info.field_nodes[0].directives:
|
35
33
|
if directive.name.value in SPECIFIED_DIRECTIVES:
|
36
34
|
continue
|
37
35
|
strawberry_directive, arguments = process_directive(directive, value, info)
|
@@ -51,9 +49,7 @@ class DirectivesExtensionSync(SchemaExtension):
|
|
51
49
|
) -> AwaitableOrValue[Any]:
|
52
50
|
value = _next(root, info, *args, **kwargs)
|
53
51
|
|
54
|
-
|
55
|
-
|
56
|
-
for directive in nodes[0].directives:
|
52
|
+
for directive in info.field_nodes[0].directives:
|
57
53
|
if directive.name.value in SPECIFIED_DIRECTIVES:
|
58
54
|
continue
|
59
55
|
strawberry_directive, arguments = process_directive(directive, value, info)
|
@@ -1,8 +1,7 @@
|
|
1
1
|
from collections.abc import Iterator
|
2
|
-
from typing import
|
2
|
+
from typing import Callable
|
3
3
|
|
4
4
|
from graphql.error import GraphQLError
|
5
|
-
from graphql.execution import ExecutionResult
|
6
5
|
|
7
6
|
from strawberry.extensions.base_extension import SchemaExtension
|
8
7
|
|
@@ -34,30 +33,18 @@ class MaskErrors(SchemaExtension):
|
|
34
33
|
original_error=None,
|
35
34
|
)
|
36
35
|
|
37
|
-
# TODO: proper typing
|
38
|
-
def _process_result(self, result: Any) -> None:
|
39
|
-
if not result.errors:
|
40
|
-
return
|
41
|
-
|
42
|
-
processed_errors: list[GraphQLError] = []
|
43
|
-
|
44
|
-
for error in result.errors:
|
45
|
-
if self.should_mask_error(error):
|
46
|
-
processed_errors.append(self.anonymise_error(error))
|
47
|
-
else:
|
48
|
-
processed_errors.append(error)
|
49
|
-
|
50
|
-
result.errors = processed_errors
|
51
|
-
|
52
36
|
def on_operation(self) -> Iterator[None]:
|
53
37
|
yield
|
54
|
-
|
55
38
|
result = self.execution_context.result
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
39
|
+
if result and result.errors:
|
40
|
+
processed_errors: list[GraphQLError] = []
|
41
|
+
for error in result.errors:
|
42
|
+
if self.should_mask_error(error):
|
43
|
+
processed_errors.append(self.anonymise_error(error))
|
44
|
+
else:
|
45
|
+
processed_errors.append(error)
|
46
|
+
|
47
|
+
result.errors = processed_errors
|
61
48
|
|
62
49
|
|
63
50
|
__all__ = ["MaskErrors"]
|
strawberry/http/__init__.py
CHANGED
@@ -1,36 +1,26 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
from dataclasses import dataclass
|
4
|
-
from typing import Any, Optional
|
4
|
+
from typing import TYPE_CHECKING, Any, Optional
|
5
5
|
from typing_extensions import Literal, TypedDict
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
ResultType,
|
10
|
-
)
|
7
|
+
if TYPE_CHECKING:
|
8
|
+
from strawberry.types import ExecutionResult
|
11
9
|
|
12
10
|
|
13
11
|
class GraphQLHTTPResponse(TypedDict, total=False):
|
14
12
|
data: Optional[dict[str, object]]
|
15
13
|
errors: Optional[list[object]]
|
16
14
|
extensions: Optional[dict[str, object]]
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
return result
|
27
|
-
|
28
|
-
errors, extensions = result.errors, result.extensions
|
29
|
-
data: GraphQLHTTPResponse = {
|
30
|
-
"data": result.data,
|
31
|
-
**({"errors": [err.formatted for err in errors]} if errors else {}),
|
32
|
-
**({"extensions": extensions} if extensions else {}),
|
33
|
-
}
|
15
|
+
|
16
|
+
|
17
|
+
def process_result(result: ExecutionResult) -> GraphQLHTTPResponse:
|
18
|
+
data: GraphQLHTTPResponse = {"data": result.data}
|
19
|
+
|
20
|
+
if result.errors:
|
21
|
+
data["errors"] = [err.formatted for err in result.errors]
|
22
|
+
if result.extensions:
|
23
|
+
data["extensions"] = result.extensions
|
34
24
|
|
35
25
|
return data
|
36
26
|
|
@@ -25,9 +25,6 @@ from strawberry.http import (
|
|
25
25
|
process_result,
|
26
26
|
)
|
27
27
|
from strawberry.http.ides import GraphQL_IDE
|
28
|
-
from strawberry.schema._graphql_core import (
|
29
|
-
GraphQLIncrementalExecutionResults,
|
30
|
-
)
|
31
28
|
from strawberry.schema.base import BaseSchema
|
32
29
|
from strawberry.schema.exceptions import (
|
33
30
|
CannotGetOperationTypeError,
|
@@ -355,75 +352,6 @@ class AsyncBaseHTTPView(
|
|
355
352
|
"Content-Type": "multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json",
|
356
353
|
},
|
357
354
|
)
|
358
|
-
if isinstance(result, GraphQLIncrementalExecutionResults):
|
359
|
-
|
360
|
-
async def stream() -> AsyncGenerator[str, None]:
|
361
|
-
yield "---"
|
362
|
-
|
363
|
-
response = await self.process_result(request, result.initial_result)
|
364
|
-
|
365
|
-
response["hasNext"] = result.initial_result.has_next
|
366
|
-
response["pending"] = [
|
367
|
-
p.formatted for p in result.initial_result.pending
|
368
|
-
]
|
369
|
-
response["extensions"] = result.initial_result.extensions
|
370
|
-
|
371
|
-
yield self.encode_multipart_data(response, "-")
|
372
|
-
|
373
|
-
all_pending = result.initial_result.pending
|
374
|
-
|
375
|
-
async for value in result.subsequent_results:
|
376
|
-
response = {
|
377
|
-
"hasNext": value.has_next,
|
378
|
-
"extensions": value.extensions,
|
379
|
-
}
|
380
|
-
|
381
|
-
if value.pending:
|
382
|
-
response["pending"] = [p.formatted for p in value.pending]
|
383
|
-
|
384
|
-
if value.completed:
|
385
|
-
response["completed"] = [p.formatted for p in value.completed]
|
386
|
-
|
387
|
-
if value.incremental:
|
388
|
-
incremental = []
|
389
|
-
|
390
|
-
all_pending.extend(value.pending)
|
391
|
-
|
392
|
-
for incremental_value in value.incremental:
|
393
|
-
pending_value = next(
|
394
|
-
(
|
395
|
-
v
|
396
|
-
for v in all_pending
|
397
|
-
if v.id == incremental_value.id
|
398
|
-
),
|
399
|
-
None,
|
400
|
-
)
|
401
|
-
|
402
|
-
assert pending_value
|
403
|
-
|
404
|
-
incremental.append(
|
405
|
-
{
|
406
|
-
**incremental_value.formatted,
|
407
|
-
"path": pending_value.path,
|
408
|
-
"label": pending_value.label,
|
409
|
-
}
|
410
|
-
)
|
411
|
-
|
412
|
-
response["incremental"] = incremental
|
413
|
-
|
414
|
-
yield self.encode_multipart_data(response, "-")
|
415
|
-
|
416
|
-
yield "--\r\n"
|
417
|
-
|
418
|
-
return await self.create_streaming_response(
|
419
|
-
request,
|
420
|
-
stream,
|
421
|
-
sub_response,
|
422
|
-
headers={
|
423
|
-
"Transfer-Encoding": "chunked",
|
424
|
-
"Content-Type": 'multipart/mixed; boundary="-"',
|
425
|
-
},
|
426
|
-
)
|
427
355
|
|
428
356
|
response_data = await self.process_result(request=request, result=result)
|
429
357
|
|
@@ -435,16 +363,12 @@ class AsyncBaseHTTPView(
|
|
435
363
|
)
|
436
364
|
|
437
365
|
def encode_multipart_data(self, data: Any, separator: str) -> str:
|
438
|
-
encoded_data = self.encode_json(data)
|
439
|
-
|
440
366
|
return "".join(
|
441
367
|
[
|
442
|
-
"\r\n",
|
443
|
-
"Content-Type: application/json
|
444
|
-
|
445
|
-
"\
|
446
|
-
encoded_data,
|
447
|
-
f"\r\n--{separator}",
|
368
|
+
f"\r\n--{separator}\r\n",
|
369
|
+
"Content-Type: application/json\r\n\r\n",
|
370
|
+
self.encode_json(data),
|
371
|
+
"\n",
|
448
372
|
]
|
449
373
|
)
|
450
374
|
|
@@ -617,11 +541,18 @@ class AsyncBaseHTTPView(
|
|
617
541
|
"The GraphQL operation's `variables` must be an object or null, if provided.",
|
618
542
|
)
|
619
543
|
|
544
|
+
extensions = data.get("extensions")
|
545
|
+
if not isinstance(extensions, (dict, type(None))):
|
546
|
+
raise HTTPException(
|
547
|
+
400,
|
548
|
+
"The GraphQL operation's `extensions` must be an object or null, if provided.",
|
549
|
+
)
|
550
|
+
|
620
551
|
return GraphQLRequestData(
|
621
552
|
query=query,
|
622
553
|
variables=variables,
|
623
554
|
operation_name=data.get("operationName"),
|
624
|
-
extensions=
|
555
|
+
extensions=extensions,
|
625
556
|
protocol=protocol,
|
626
557
|
)
|
627
558
|
|
@@ -166,11 +166,18 @@ class SyncBaseHTTPView(
|
|
166
166
|
"The GraphQL operation's `variables` must be an object or null, if provided.",
|
167
167
|
)
|
168
168
|
|
169
|
+
extensions = data.get("extensions")
|
170
|
+
if not isinstance(extensions, (dict, type(None))):
|
171
|
+
raise HTTPException(
|
172
|
+
400,
|
173
|
+
"The GraphQL operation's `extensions` must be an object or null, if provided.",
|
174
|
+
)
|
175
|
+
|
169
176
|
return GraphQLRequestData(
|
170
177
|
query=query,
|
171
178
|
variables=variables,
|
172
179
|
operation_name=data.get("operationName"),
|
173
|
-
extensions=
|
180
|
+
extensions=extensions,
|
174
181
|
)
|
175
182
|
|
176
183
|
def _handle_errors(
|
strawberry/printer/printer.py
CHANGED
@@ -561,9 +561,9 @@ def print_schema_definition(
|
|
561
561
|
def print_directive(
|
562
562
|
directive: GraphQLDirective, *, schema: BaseSchema
|
563
563
|
) -> Optional[str]:
|
564
|
-
strawberry_directive = directive.extensions
|
564
|
+
strawberry_directive = directive.extensions["strawberry-definition"]
|
565
565
|
|
566
|
-
if
|
566
|
+
if (
|
567
567
|
isinstance(strawberry_directive, StrawberrySchemaDirective)
|
568
568
|
and not strawberry_directive.print_definition
|
569
569
|
):
|
@@ -621,14 +621,6 @@ def print_schema(schema: BaseSchema) -> str:
|
|
621
621
|
if (printed_directive := print_directive(directive, schema=schema)) is not None
|
622
622
|
]
|
623
623
|
|
624
|
-
if schema.config.enable_experimental_incremental_execution:
|
625
|
-
directives.append(
|
626
|
-
"directive @defer(if: Boolean, label: String) on FRAGMENT_SPREAD | INLINE_FRAGMENT"
|
627
|
-
)
|
628
|
-
directives.append(
|
629
|
-
"directive @stream(if: Boolean, label: String, initialCount: Int = 0) on FIELD"
|
630
|
-
)
|
631
|
-
|
632
624
|
def _name_getter(type_: Any) -> str:
|
633
625
|
if hasattr(type_, "name"):
|
634
626
|
return type_.name
|
strawberry/relay/fields.py
CHANGED
@@ -261,7 +261,12 @@ class ConnectionExtension(FieldExtension):
|
|
261
261
|
if isinstance(f_type, StrawberryOptional):
|
262
262
|
f_type = f_type.of_type
|
263
263
|
|
264
|
+
if isinstance(f_type, LazyType):
|
265
|
+
f_type = f_type.resolve_type()
|
266
|
+
|
264
267
|
type_origin = get_origin(f_type) if is_generic_alias(f_type) else f_type
|
268
|
+
if isinstance(type_origin, LazyType):
|
269
|
+
type_origin = type_origin.resolve_type()
|
265
270
|
|
266
271
|
if not isinstance(type_origin, type) or not issubclass(type_origin, Connection):
|
267
272
|
raise RelayWrongAnnotationError(field.name, cast("type", field.origin))
|
strawberry/relay/types.py
CHANGED
strawberry/schema/config.py
CHANGED
@@ -17,7 +17,6 @@ class StrawberryConfig:
|
|
17
17
|
relay_use_legacy_global_id: bool = False
|
18
18
|
disable_field_suggestions: bool = False
|
19
19
|
info_class: type[Info] = Info
|
20
|
-
enable_experimental_incremental_execution: bool = False
|
21
20
|
_unsafe_disable_same_type_validation: bool = False
|
22
21
|
|
23
22
|
def __post_init__(
|
@@ -150,8 +150,9 @@ class NameConverter:
|
|
150
150
|
type_ = eval_type(type_)
|
151
151
|
|
152
152
|
if isinstance(type_, LazyType):
|
153
|
-
|
154
|
-
|
153
|
+
type_ = type_.resolve_type()
|
154
|
+
|
155
|
+
if isinstance(type_, EnumDefinition):
|
155
156
|
name = type_.name
|
156
157
|
elif isinstance(type_, StrawberryUnion):
|
157
158
|
name = type_.graphql_name if type_.graphql_name else self.from_union(type_)
|
strawberry/schema/schema.py
CHANGED
@@ -15,6 +15,7 @@ from typing import (
|
|
15
15
|
cast,
|
16
16
|
)
|
17
17
|
|
18
|
+
from graphql import ExecutionContext as GraphQLExecutionContext
|
18
19
|
from graphql import ExecutionResult as GraphQLExecutionResult
|
19
20
|
from graphql import (
|
20
21
|
ExecutionResult as OriginalExecutionResult,
|
@@ -35,6 +36,7 @@ from graphql import (
|
|
35
36
|
parse,
|
36
37
|
validate_schema,
|
37
38
|
)
|
39
|
+
from graphql.execution import execute, subscribe
|
38
40
|
from graphql.execution.middleware import MiddlewareManager
|
39
41
|
from graphql.type.directives import specified_directives
|
40
42
|
from graphql.validation import validate
|
@@ -67,15 +69,6 @@ from strawberry.utils.aio import aclosing
|
|
67
69
|
from strawberry.utils.await_maybe import await_maybe
|
68
70
|
|
69
71
|
from . import compat
|
70
|
-
from ._graphql_core import (
|
71
|
-
GraphQLExecutionContext,
|
72
|
-
GraphQLIncrementalExecutionResults,
|
73
|
-
ResultType,
|
74
|
-
execute,
|
75
|
-
experimental_execute_incrementally,
|
76
|
-
incremental_execution_directives,
|
77
|
-
subscribe,
|
78
|
-
)
|
79
72
|
from .base import BaseSchema
|
80
73
|
from .config import StrawberryConfig
|
81
74
|
from .exceptions import CannotGetOperationTypeError, InvalidOperationTypeError
|
@@ -84,6 +77,7 @@ if TYPE_CHECKING:
|
|
84
77
|
from collections.abc import Iterable, Mapping
|
85
78
|
from typing_extensions import TypeAlias
|
86
79
|
|
80
|
+
from graphql.execution.collect_fields import FieldGroup # type: ignore
|
87
81
|
from graphql.language import DocumentNode
|
88
82
|
from graphql.pyutils import Path
|
89
83
|
from graphql.type import GraphQLResolveInfo
|
@@ -105,7 +99,6 @@ OriginSubscriptionResult = Union[
|
|
105
99
|
AsyncIterator[OriginalExecutionResult],
|
106
100
|
]
|
107
101
|
|
108
|
-
|
109
102
|
DEFAULT_ALLOWED_OPERATION_TYPES = {
|
110
103
|
OperationType.QUERY,
|
111
104
|
OperationType.MUTATION,
|
@@ -175,18 +168,17 @@ class StrawberryGraphQLCoreExecutionContext(GraphQLExecutionContext):
|
|
175
168
|
|
176
169
|
self.operation_extensions = operation_extensions
|
177
170
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
) -> GraphQLResolveInfo:
|
171
|
+
def build_resolve_info(
|
172
|
+
self,
|
173
|
+
field_def: GraphQLField,
|
174
|
+
field_group: FieldGroup,
|
175
|
+
parent_type: GraphQLObjectType,
|
176
|
+
path: Path,
|
177
|
+
) -> GraphQLResolveInfo:
|
178
|
+
if IS_GQL_33:
|
187
179
|
return _OperationContextAwareGraphQLResolveInfo( # type: ignore
|
188
|
-
|
189
|
-
|
180
|
+
field_group.fields[0].node.name.value,
|
181
|
+
field_group.to_nodes(),
|
190
182
|
field_def.type,
|
191
183
|
parent_type,
|
192
184
|
path,
|
@@ -200,6 +192,13 @@ class StrawberryGraphQLCoreExecutionContext(GraphQLExecutionContext):
|
|
200
192
|
self.operation_extensions,
|
201
193
|
)
|
202
194
|
|
195
|
+
return super().build_resolve_info(
|
196
|
+
field_def,
|
197
|
+
field_group,
|
198
|
+
parent_type,
|
199
|
+
path,
|
200
|
+
)
|
201
|
+
|
203
202
|
|
204
203
|
class Schema(BaseSchema):
|
205
204
|
def __init__(
|
@@ -322,16 +321,11 @@ class Schema(BaseSchema):
|
|
322
321
|
graphql_types.append(graphql_type)
|
323
322
|
|
324
323
|
try:
|
325
|
-
directives = specified_directives + tuple(graphql_directives) # type: ignore
|
326
|
-
|
327
|
-
if self.config.enable_experimental_incremental_execution:
|
328
|
-
directives = tuple(directives) + tuple(incremental_execution_directives)
|
329
|
-
|
330
324
|
self._schema = GraphQLSchema(
|
331
325
|
query=query_type,
|
332
326
|
mutation=mutation_type,
|
333
327
|
subscription=subscription_type if subscription else None,
|
334
|
-
directives=
|
328
|
+
directives=specified_directives + tuple(graphql_directives),
|
335
329
|
types=graphql_types,
|
336
330
|
extensions={
|
337
331
|
GraphQLCoreConverter.DEFINITION_BACKREF: self,
|
@@ -524,16 +518,12 @@ class Schema(BaseSchema):
|
|
524
518
|
async def _handle_execution_result(
|
525
519
|
self,
|
526
520
|
context: ExecutionContext,
|
527
|
-
result:
|
521
|
+
result: Union[GraphQLExecutionResult, ExecutionResult],
|
528
522
|
extensions_runner: SchemaExtensionsRunner,
|
529
523
|
*,
|
530
524
|
# TODO: can we remove this somehow, see comment in execute
|
531
525
|
skip_process_errors: bool = False,
|
532
526
|
) -> ExecutionResult:
|
533
|
-
# TODO: handle this, also, why do we have both GraphQLExecutionResult and ExecutionResult?
|
534
|
-
if isinstance(result, GraphQLIncrementalExecutionResults):
|
535
|
-
return result
|
536
|
-
|
537
527
|
# Set errors on the context so that it's easier
|
538
528
|
# to access in extensions
|
539
529
|
if result.errors:
|
@@ -576,17 +566,6 @@ class Schema(BaseSchema):
|
|
576
566
|
extensions_runner = self.create_extensions_runner(execution_context, extensions)
|
577
567
|
middleware_manager = self._get_middleware_manager(extensions)
|
578
568
|
|
579
|
-
execute_function = execute
|
580
|
-
|
581
|
-
if self.config.enable_experimental_incremental_execution:
|
582
|
-
execute_function = experimental_execute_incrementally
|
583
|
-
|
584
|
-
if execute_function is None:
|
585
|
-
raise RuntimeError(
|
586
|
-
"Incremental execution is enabled but experimental_execute_incrementally is not available, "
|
587
|
-
"please install graphql-core>=3.3.0"
|
588
|
-
)
|
589
|
-
|
590
569
|
custom_context_kwargs = self._get_custom_context_kwargs(operation_extensions)
|
591
570
|
|
592
571
|
try:
|
@@ -607,7 +586,7 @@ class Schema(BaseSchema):
|
|
607
586
|
async with extensions_runner.executing():
|
608
587
|
if not execution_context.result:
|
609
588
|
result = await await_maybe(
|
610
|
-
|
589
|
+
execute(
|
611
590
|
self._schema,
|
612
591
|
execution_context.graphql_document,
|
613
592
|
root_value=execution_context.root_value,
|
@@ -624,9 +603,7 @@ class Schema(BaseSchema):
|
|
624
603
|
result = execution_context.result
|
625
604
|
# Also set errors on the execution_context so that it's easier
|
626
605
|
# to access in extensions
|
627
|
-
|
628
|
-
# TODO: maybe here use the first result from incremental execution if it exists
|
629
|
-
if isinstance(result, GraphQLExecutionResult) and result.errors:
|
606
|
+
if result.errors:
|
630
607
|
execution_context.errors = result.errors
|
631
608
|
|
632
609
|
# Run the `Schema.process_errors` function here before
|
@@ -682,16 +659,6 @@ class Schema(BaseSchema):
|
|
682
659
|
extensions_runner = self.create_extensions_runner(execution_context, extensions)
|
683
660
|
middleware_manager = self._get_middleware_manager(extensions)
|
684
661
|
|
685
|
-
execute_function = execute
|
686
|
-
|
687
|
-
if self.config.enable_experimental_incremental_execution:
|
688
|
-
execute_function = experimental_execute_incrementally
|
689
|
-
|
690
|
-
if execute_function is None:
|
691
|
-
raise RuntimeError(
|
692
|
-
"Incremental execution is enabled but experimental_execute_incrementally is not available, "
|
693
|
-
"please install graphql-core>=3.3.0"
|
694
|
-
)
|
695
662
|
custom_context_kwargs = self._get_custom_context_kwargs(operation_extensions)
|
696
663
|
|
697
664
|
try:
|
@@ -742,7 +709,7 @@ class Schema(BaseSchema):
|
|
742
709
|
|
743
710
|
with extensions_runner.executing():
|
744
711
|
if not execution_context.result:
|
745
|
-
result =
|
712
|
+
result = execute(
|
746
713
|
self._schema,
|
747
714
|
execution_context.graphql_document,
|
748
715
|
root_value=execution_context.root_value,
|
@@ -1003,43 +1003,11 @@ class GraphQLCoreConverter:
|
|
1003
1003
|
first_type_definition = cached_type.definition
|
1004
1004
|
second_type_definition = type_definition
|
1005
1005
|
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
and isinstance(second_type_definition, StrawberryObjectDefinition)
|
1010
|
-
and first_type_definition.concrete_of is not None
|
1011
|
-
and first_type_definition.concrete_of == second_type_definition.concrete_of
|
1012
|
-
and (
|
1013
|
-
first_type_definition.type_var_map.keys()
|
1014
|
-
== second_type_definition.type_var_map.keys()
|
1015
|
-
)
|
1006
|
+
if self.is_same_type_definition(
|
1007
|
+
first_type_definition,
|
1008
|
+
second_type_definition,
|
1016
1009
|
):
|
1017
|
-
|
1018
|
-
# so that they're considered equal to the actual types they're referencing
|
1019
|
-
equal = True
|
1020
|
-
for type_var, type1 in first_type_definition.type_var_map.items():
|
1021
|
-
type2 = second_type_definition.type_var_map[type_var]
|
1022
|
-
# both lazy types are always resolved because two different lazy types
|
1023
|
-
# may be referencing the same actual type
|
1024
|
-
if isinstance(type1, LazyType):
|
1025
|
-
type1 = type1.resolve_type() # noqa: PLW2901
|
1026
|
-
elif isinstance(type1, StrawberryOptional) and isinstance(
|
1027
|
-
type1.of_type, LazyType
|
1028
|
-
):
|
1029
|
-
type1.of_type = type1.of_type.resolve_type()
|
1030
|
-
|
1031
|
-
if isinstance(type2, LazyType):
|
1032
|
-
type2 = type2.resolve_type()
|
1033
|
-
elif isinstance(type2, StrawberryOptional) and isinstance(
|
1034
|
-
type2.of_type, LazyType
|
1035
|
-
):
|
1036
|
-
type2.of_type = type2.of_type.resolve_type()
|
1037
|
-
|
1038
|
-
if type1 != type2:
|
1039
|
-
equal = False
|
1040
|
-
break
|
1041
|
-
if equal:
|
1042
|
-
return
|
1010
|
+
return
|
1043
1011
|
|
1044
1012
|
if isinstance(second_type_definition, StrawberryObjectDefinition):
|
1045
1013
|
first_origin = second_type_definition.origin
|
@@ -1057,5 +1025,63 @@ class GraphQLCoreConverter:
|
|
1057
1025
|
|
1058
1026
|
raise DuplicatedTypeName(first_origin, second_origin, name)
|
1059
1027
|
|
1028
|
+
def is_same_type_definition(
|
1029
|
+
self,
|
1030
|
+
first_type_definition: StrawberryObjectDefinition | StrawberryType,
|
1031
|
+
second_type_definition: StrawberryObjectDefinition | StrawberryType,
|
1032
|
+
) -> bool:
|
1033
|
+
# TODO: maybe move this on the StrawberryType class
|
1034
|
+
if (
|
1035
|
+
not isinstance(first_type_definition, StrawberryObjectDefinition)
|
1036
|
+
or not isinstance(second_type_definition, StrawberryObjectDefinition)
|
1037
|
+
or first_type_definition.concrete_of is None
|
1038
|
+
or first_type_definition.concrete_of != second_type_definition.concrete_of
|
1039
|
+
or (
|
1040
|
+
first_type_definition.type_var_map.keys()
|
1041
|
+
!= second_type_definition.type_var_map.keys()
|
1042
|
+
)
|
1043
|
+
):
|
1044
|
+
return False
|
1045
|
+
|
1046
|
+
# manually compare type_var_maps while resolving any lazy types
|
1047
|
+
# so that they're considered equal to the actual types they're referencing
|
1048
|
+
for type_var, type1 in first_type_definition.type_var_map.items():
|
1049
|
+
type2 = second_type_definition.type_var_map[type_var]
|
1050
|
+
|
1051
|
+
# both lazy types are always resolved because two different lazy types
|
1052
|
+
# may be referencing the same actual type
|
1053
|
+
if isinstance(type1, LazyType):
|
1054
|
+
type1 = type1.resolve_type() # noqa: PLW2901
|
1055
|
+
elif isinstance(type1, StrawberryOptional) and isinstance(
|
1056
|
+
type1.of_type, LazyType
|
1057
|
+
):
|
1058
|
+
type1.of_type = type1.of_type.resolve_type()
|
1059
|
+
|
1060
|
+
if isinstance(type2, LazyType):
|
1061
|
+
type2 = type2.resolve_type()
|
1062
|
+
elif isinstance(type2, StrawberryOptional) and isinstance(
|
1063
|
+
type2.of_type, LazyType
|
1064
|
+
):
|
1065
|
+
type2.of_type = type2.of_type.resolve_type()
|
1066
|
+
|
1067
|
+
same_type = type1 == type2
|
1068
|
+
# If both types have object definitions, we are handling a nested generic
|
1069
|
+
# type like `Foo[Foo[int]]`, meaning we need to compare their type definitions
|
1070
|
+
# as they will actually be different instances of the type
|
1071
|
+
if (
|
1072
|
+
not same_type
|
1073
|
+
and has_object_definition(type1)
|
1074
|
+
and has_object_definition(type2)
|
1075
|
+
):
|
1076
|
+
same_type = self.is_same_type_definition(
|
1077
|
+
type1.__strawberry_definition__,
|
1078
|
+
type2.__strawberry_definition__,
|
1079
|
+
)
|
1080
|
+
|
1081
|
+
if not same_type:
|
1082
|
+
return False
|
1083
|
+
|
1084
|
+
return True
|
1085
|
+
|
1060
1086
|
|
1061
1087
|
__all__ = ["GraphQLCoreConverter"]
|
strawberry/static/graphiql.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
<!
|
1
|
+
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Strawberry GraphiQL</title>
|
@@ -61,8 +61,8 @@
|
|
61
61
|
<link
|
62
62
|
crossorigin
|
63
63
|
rel="stylesheet"
|
64
|
-
href="https://unpkg.com/graphiql@3.
|
65
|
-
integrity="sha384-
|
64
|
+
href="https://unpkg.com/graphiql@3.0.9/graphiql.min.css"
|
65
|
+
integrity="sha384-yz3/sqpuplkA7msMo0FE4ekg0xdwdvZ8JX9MVZREsxipqjU4h8IRfmAMRcb1QpUy"
|
66
66
|
/>
|
67
67
|
|
68
68
|
<link
|
@@ -77,8 +77,8 @@
|
|
77
77
|
<div id="graphiql" class="graphiql-container">Loading...</div>
|
78
78
|
<script
|
79
79
|
crossorigin
|
80
|
-
src="https://unpkg.com/graphiql@3.
|
81
|
-
integrity="sha384-
|
80
|
+
src="https://unpkg.com/graphiql@3.0.9/graphiql.min.js"
|
81
|
+
integrity="sha384-Mjte+vxCWz1ZYCzszGHiJqJa5eAxiqI4mc3BErq7eDXnt+UGLXSEW7+i0wmfPiji"
|
82
82
|
></script>
|
83
83
|
<script
|
84
84
|
crossorigin
|
strawberry/types/execution.py
CHANGED
@@ -18,11 +18,11 @@ if TYPE_CHECKING:
|
|
18
18
|
from typing_extensions import NotRequired
|
19
19
|
|
20
20
|
from graphql import ASTValidationRule
|
21
|
+
from graphql import ExecutionResult as GraphQLExecutionResult
|
21
22
|
from graphql.error.graphql_error import GraphQLError
|
22
23
|
from graphql.language import DocumentNode, OperationDefinitionNode
|
23
24
|
|
24
25
|
from strawberry.schema import Schema
|
25
|
-
from strawberry.schema._graphql_core import GraphQLExecutionResult
|
26
26
|
|
27
27
|
from .graphql import OperationType
|
28
28
|
|
{strawberry_graphql-0.276.0.dev1752831589.dist-info → strawberry_graphql-0.276.1.dist-info}/RECORD
RENAMED
@@ -1,10 +1,10 @@
|
|
1
|
-
strawberry/__init__.py,sha256
|
1
|
+
strawberry/__init__.py,sha256=-K---AYIgHvBVYF_9oovgEPNBbymXH673bntlV9sOeU,1491
|
2
2
|
strawberry/__main__.py,sha256=3U77Eu21mJ-LY27RG-JEnpbh6Z63wGOom4i-EoLtUcY,59
|
3
3
|
strawberry/aiohttp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
strawberry/aiohttp/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
|
5
5
|
strawberry/aiohttp/test/client.py,sha256=8FKZTnvawxYpgEICOri-34O3wHRHLhRpjH_Ktp2EupQ,1801
|
6
6
|
strawberry/aiohttp/views.py,sha256=EhsaD0Ms7qhHxGyS0qDbRPKxz3VUaSdsbEZKTniIjaM,7962
|
7
|
-
strawberry/annotation.py,sha256=
|
7
|
+
strawberry/annotation.py,sha256=FS-5IIEhFit79QIQyWebaScO9kFZYY_jKOLKCXBhXrw,13828
|
8
8
|
strawberry/asgi/__init__.py,sha256=psdKl_52LGkxKKbzZlmwNGZ9jz2FLyLSC7fUhys4FqY,8169
|
9
9
|
strawberry/asgi/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
|
10
10
|
strawberry/asgi/test/client.py,sha256=kp2O5znHWuAB5VVYO8p4XPSTEDDXBSjNz5WHqW0r6GM,1473
|
@@ -17,7 +17,7 @@ strawberry/channels/handlers/http_handler.py,sha256=L_4zekdYMcUiE_654eATETe_FJGC
|
|
17
17
|
strawberry/channels/handlers/ws_handler.py,sha256=-Iao0rIuprnRmEpbxvFFyI_dR27_MeyO2iVkOv7qF00,6177
|
18
18
|
strawberry/channels/router.py,sha256=DKIbl4zuRBhfvViUVpyu0Rf_WRT41E6uZC-Yic9Ltvo,2024
|
19
19
|
strawberry/channels/testing.py,sha256=dc9mvSm9YdNOUgQk5ou5K4iE2h6TP5quKnk4Xdtn-IY,6558
|
20
|
-
strawberry/cli/__init__.py,sha256=
|
20
|
+
strawberry/cli/__init__.py,sha256=9rqBIeRSi0P0JljMWO43KC3inm4BBf0CX5pEWQWnTos,662
|
21
21
|
strawberry/cli/app.py,sha256=tTMBV1pdWqMcwjWO2yn-8oLDhMhfJvUzyQtWs75LWJ0,54
|
22
22
|
strawberry/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
strawberry/cli/commands/codegen.py,sha256=WbX8uqF-dpQk1QjQm3H4AvNSZ4lIUOTSPghii3attj8,3812
|
@@ -81,7 +81,7 @@ strawberry/experimental/pydantic/conversion_types.py,sha256=jf7PR5Q7hgo4J_AuxBK-
|
|
81
81
|
strawberry/experimental/pydantic/error_type.py,sha256=RdmiUY4V0baXCAk80ST-XtCiZbndZaaUSEajQplDAzw,4557
|
82
82
|
strawberry/experimental/pydantic/exceptions.py,sha256=pDMPL94ojuSGHxk8H8mI2pfWReG8BhqZ5T2eSxfOi9w,1486
|
83
83
|
strawberry/experimental/pydantic/fields.py,sha256=NcB38JYk29fPwJWtoHkIvwTfqD2Ekf7fJ57GjvvK6mQ,2265
|
84
|
-
strawberry/experimental/pydantic/object_type.py,sha256=
|
84
|
+
strawberry/experimental/pydantic/object_type.py,sha256=lcQgmWLulegTlGWmj_9GhPv1d2L_DdPpimVgMEr9aT0,12897
|
85
85
|
strawberry/experimental/pydantic/utils.py,sha256=URSzmcK2KzNGsLv4RyFdFfJnr-ARNLkkM0D4CjijVQU,4035
|
86
86
|
strawberry/ext/LICENSE,sha256=_oY0TZg0b_sW0--0T44aMTpy2e2zF1Kiyn8E1qDiivo,1249
|
87
87
|
strawberry/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -94,11 +94,11 @@ strawberry/extensions/__init__.py,sha256=2TXnEVXumViXzBe-9ppb0CX90Wbc6644IE7aJQA
|
|
94
94
|
strawberry/extensions/add_validation_rules.py,sha256=YwC_27jUpQ6DWcCB1RsuE1JD8R5rV7LAu5fVjdLchYs,1358
|
95
95
|
strawberry/extensions/base_extension.py,sha256=ihsbUrhYt-x4X1j5a34FASmNF661Xev-3w4Qc5gUbHw,2351
|
96
96
|
strawberry/extensions/context.py,sha256=9hTWNjxk-Kyr4RkpKE3BY05dkgS4WLRjJKj4tq28Lj8,7185
|
97
|
-
strawberry/extensions/directives.py,sha256=
|
97
|
+
strawberry/extensions/directives.py,sha256=F-ayBAImKHFap61WUJ_XO02COOFn3nWyN7cLkV9Dph0,3032
|
98
98
|
strawberry/extensions/disable_introspection.py,sha256=7FmktNvc9CzOJG9xf_nYG3LThs0cv-g2P-Kzlerna7w,717
|
99
99
|
strawberry/extensions/disable_validation.py,sha256=WaA7x6Q-K4IMnvx35OQ1UtokIKaxkWvO_OJO9fFM_vA,750
|
100
100
|
strawberry/extensions/field_extension.py,sha256=VUwUBbf57Vp_Ukc3Rh9eZDRuF2ubzRRipzsU-w5bAFc,5561
|
101
|
-
strawberry/extensions/mask_errors.py,sha256=
|
101
|
+
strawberry/extensions/mask_errors.py,sha256=xPGN24l6C_zZ174jHQbOhSShTqqAB58ithhuTZjBXGQ,1481
|
102
102
|
strawberry/extensions/max_aliases.py,sha256=qaV9rqHTqfhh7YdFnXVvjf14wmAiXBtKHGAxb1Yv4DQ,2547
|
103
103
|
strawberry/extensions/max_tokens.py,sha256=53Gb0tSj-G7so_vLokdmtUal4KCXQBYLJi1LSIvdkXE,1045
|
104
104
|
strawberry/extensions/parser_cache.py,sha256=oi6Svpy21_YP-d9G3nv_5HzJPw5FyBhWplCYnzcKwO8,1291
|
@@ -134,13 +134,13 @@ strawberry/file_uploads/scalars.py,sha256=NRDeB7j8aotqIkz9r62ISTf4DrxQxEZYUuHsX5
|
|
134
134
|
strawberry/file_uploads/utils.py,sha256=-c6TbqUI-Dkb96hWCrZabh6TL2OabBuQNkCarOqgDm4,1181
|
135
135
|
strawberry/flask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
136
136
|
strawberry/flask/views.py,sha256=MCvAsNgTZLU8RvTYKWfnLU2w7Wv1ZZpxW9W3TyTZuPY,6355
|
137
|
-
strawberry/http/__init__.py,sha256=
|
138
|
-
strawberry/http/async_base_view.py,sha256=
|
137
|
+
strawberry/http/__init__.py,sha256=ytAirKk7K7D5knY21tpCGeZ-sCPgwMsijL5AxmOy-94,1163
|
138
|
+
strawberry/http/async_base_view.py,sha256=N72Ym9b1z8VbzrgrMDehoKSLFUdObK4fJ1aRZRjZQ1U,20806
|
139
139
|
strawberry/http/base.py,sha256=MiX0-RqOkhRvlfpmuvgTHp4tygbUmG8fnLc0uCrOllU,2550
|
140
140
|
strawberry/http/exceptions.py,sha256=9E2dreS1crRoJVUEPuHyx23NcDELDHNzkAOa-rGv-8I,348
|
141
141
|
strawberry/http/ides.py,sha256=WjU0nsMDgr3Bd1ebWkUEkO2d1hk0dI16mLqXyCHqklA,613
|
142
142
|
strawberry/http/parse_content_type.py,sha256=CYHO8F9b9DP1gJ1xxPjc9L2GkBwsyC1O_GCEp1QOuG0,381
|
143
|
-
strawberry/http/sync_base_view.py,sha256=
|
143
|
+
strawberry/http/sync_base_view.py,sha256=jQwNn_No3zFMkUO0HO7w1B7YFuwZiArH3SS8HJtoDLI,8138
|
144
144
|
strawberry/http/temporal_response.py,sha256=HTt65g-YxqlPGxjqvH5bzGoU1b3CctVR-9cmCRo5dUo,196
|
145
145
|
strawberry/http/types.py,sha256=H0wGOdCO-5tNKZM_6cAtNRwZAjoEXnAC5N0Q7b70AtU,398
|
146
146
|
strawberry/http/typevars.py,sha256=Uu6NkKe3h7o29ZWwldq6sJy4ioSSeXODTCDRvY2hUpE,489
|
@@ -150,14 +150,14 @@ strawberry/parent.py,sha256=JYFp-HGCgwbH2oB4uLSiIO4cVsoPaxX6lfYmxOKPkSg,1362
|
|
150
150
|
strawberry/permission.py,sha256=dSRJMjSCmTlXfvfC24kCSrAk0txTjYKTJ5ZVU5IW91Y,7537
|
151
151
|
strawberry/printer/__init__.py,sha256=DmepjmgtkdF5RxK_7yC6qUyRWn56U-9qeZMbkztYB9w,62
|
152
152
|
strawberry/printer/ast_from_value.py,sha256=Tkme60qlykbN2m3dNPNMOe65X-wj6EmcDQwgQv7gUkc,4987
|
153
|
-
strawberry/printer/printer.py,sha256=
|
153
|
+
strawberry/printer/printer.py,sha256=49u3QwttTGvh13HXZtbTnkZzBwL1k5SLf8rXQLiTpl4,18814
|
154
154
|
strawberry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
155
155
|
strawberry/quart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
156
156
|
strawberry/quart/views.py,sha256=f41HWnkGPuhs1NkjwHOZ0DEVnlr5nMSMr9GCxNsBxCs,7461
|
157
157
|
strawberry/relay/__init__.py,sha256=Vi4btvA_g6Cj9Tk_F9GCSegapIf2WqkOWV8y3P0cTCs,553
|
158
158
|
strawberry/relay/exceptions.py,sha256=Za0iXLBGZtd1HkesGm4xTr3QOeuyiCAe1hiCCQ2HHvE,4036
|
159
|
-
strawberry/relay/fields.py,sha256=
|
160
|
-
strawberry/relay/types.py,sha256=
|
159
|
+
strawberry/relay/fields.py,sha256=eqQOH8JAWZUP52nwaYCZ_z5Jvp69_T_gx1pxjrdgV1k,18284
|
160
|
+
strawberry/relay/types.py,sha256=u3-V7LPe_CniEmREMJyvXH9L9Ecc2CWQC5hRfUvL_Q4,30477
|
161
161
|
strawberry/relay/utils.py,sha256=-QxroxkSYtFnMYsJyTyfIi0I1fLtjnt6siW0kLNiyfs,5908
|
162
162
|
strawberry/resolvers.py,sha256=Vdidc3YFc4-olSQZD_xQ1icyAFbyzqs_8I3eSpMFlA4,260
|
163
163
|
strawberry/sanic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -166,14 +166,13 @@ strawberry/sanic/utils.py,sha256=XjUVBFuBWfECBCZbx_YtrjQnFTUyIGTo7aISIeB22Gc,100
|
|
166
166
|
strawberry/sanic/views.py,sha256=F5ZrKt-R3135evKLfhQuPd1isOexI0Lrzevm_6Te4Eg,7069
|
167
167
|
strawberry/scalars.py,sha256=CGkG8CIfurXiYhidmW3qwy6M5BF_Mhih3wAEcWx_iBU,2278
|
168
168
|
strawberry/schema/__init__.py,sha256=u1QCyDVQExUVDA20kyosKPz3TS5HMCN2NrXclhiFAL4,92
|
169
|
-
strawberry/schema/_graphql_core.py,sha256=VV-6OIP5O-CUzmUT14fWpIwk81Y88rj7PLLNpmU68mk,1512
|
170
169
|
strawberry/schema/base.py,sha256=wqvEOQ_aVkfebk9SlG9zg1YXl3MlwxGZhxFRoIkAxu0,4053
|
171
170
|
strawberry/schema/compat.py,sha256=xNpOEDfi-MODpplMGaKuKeQIVcr-tcAaKaU3TlBc1Zs,1873
|
172
|
-
strawberry/schema/config.py,sha256=
|
171
|
+
strawberry/schema/config.py,sha256=6d2MPrAgq97-7aze555dRcB3yw-aeUexYMP3KVN22c0,1024
|
173
172
|
strawberry/schema/exceptions.py,sha256=8gsMxxFDynMvRkUDuVL9Wwxk_zsmo6QoJ2l4NPxd64M,1137
|
174
|
-
strawberry/schema/name_converter.py,sha256=
|
175
|
-
strawberry/schema/schema.py,sha256
|
176
|
-
strawberry/schema/schema_converter.py,sha256=
|
173
|
+
strawberry/schema/name_converter.py,sha256=JG5JKLr9wp8BMJIvG3_bVkwFdoLGbknNR1Bt75urXN0,6950
|
174
|
+
strawberry/schema/schema.py,sha256=-dVGJfOAyq-w2lpEbzCaiRNPMH68nirv-Q6gZ4aW0UU,37951
|
175
|
+
strawberry/schema/schema_converter.py,sha256=ZGkZjLsqjZ-0y5NItsECHZbOOhjJioYRT6YROwmo4Gg,40125
|
177
176
|
strawberry/schema/types/__init__.py,sha256=oHO3COWhL3L1KLYCJNY1XFf5xt2GGtHiMC-UaYbFfnA,68
|
178
177
|
strawberry/schema/types/base_scalars.py,sha256=JRUq0WjEkR9dFewstZnqnZKp0uOEipo4UXNF5dzRf4M,1971
|
179
178
|
strawberry/schema/types/concrete_type.py,sha256=axIyFZgdwNv-XYkiqX67464wuFX6Vp0jYATwnBZSUvM,750
|
@@ -184,9 +183,8 @@ strawberry/schema_codegen/__init__.py,sha256=mN4Qmu5Iakht6nHpRpt9hCs8e--oTPlVtDJ
|
|
184
183
|
strawberry/schema_directive.py,sha256=CbjdX54EIeWGkJu4SgiLR8mph5_8wyNsgJk2oLoQK_0,2023
|
185
184
|
strawberry/schema_directives.py,sha256=KGKFWCODjm1Ah9qNV_bBwbic7Mld4qLWnWQkev-PG8A,175
|
186
185
|
strawberry/static/apollo-sandbox.html,sha256=2XzkbE0dqsFHqehE-jul9_J9TFOpwA6Ylrlo0Kdx_9w,973
|
187
|
-
strawberry/static/graphiql.html,sha256=
|
186
|
+
strawberry/static/graphiql.html,sha256=BkiqZlC63f1sHBDs_UpMzcibcNrHKh7K41Sp23yttfo,4257
|
188
187
|
strawberry/static/pathfinder.html,sha256=0DPx9AmJ2C_sJstFXnWOz9k5tVQHeHaK7qdVY4lAlmk,1547
|
189
|
-
strawberry/streamable.py,sha256=ylfMt5lfX7RRKGi86wWokvIgYQk5jZCvQVc3shK0epk,645
|
190
188
|
strawberry/subscriptions/__init__.py,sha256=1VGmiCzFepqRFyCikagkUoHHdoTG3XYlFu9GafoQMws,170
|
191
189
|
strawberry/subscriptions/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
192
190
|
strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py,sha256=wN6dkMu6WiaIZTE19PGoN9xXpIN_RdDE_q7F7ZgjCxk,138
|
@@ -206,7 +204,7 @@ strawberry/types/auto.py,sha256=WZ2cQAI8nREUigBzpzFqIKGjJ_C2VqpAPNe8vPjTciM,3007
|
|
206
204
|
strawberry/types/base.py,sha256=Bfa-5Wen8qR7m6tlSMRRGlGE-chRGMHjQMopfNdbbrk,15197
|
207
205
|
strawberry/types/cast.py,sha256=fx86MkLW77GIximBAwUk5vZxSGwDqUA6XicXvz8EXwQ,916
|
208
206
|
strawberry/types/enum.py,sha256=7bK7YUzlG117_V9x-f9hx5vogcCRF6UBUFteeKhjDHg,6306
|
209
|
-
strawberry/types/execution.py,sha256=
|
207
|
+
strawberry/types/execution.py,sha256=kW5rgkWP98oysJWNc_fcxyO1PZ36NJpPTPZpZP2ZXYk,3820
|
210
208
|
strawberry/types/field.py,sha256=vxb7JvkHfRmDCYsjhDmVnO2lMbtSOteQm3jQUeSFu6g,21605
|
211
209
|
strawberry/types/fields/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
212
210
|
strawberry/types/fields/resolver.py,sha256=b6lxfw6AMOUFWm7vs7a9KzNkpR8b_S110DoIosrrWDQ,14679
|
@@ -236,8 +234,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
|
|
236
234
|
strawberry/utils/operation.py,sha256=ZgVOw3K2jQuLjNOYUHauF7itJD0QDNoPw9PBi0IYf6k,1234
|
237
235
|
strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
|
238
236
|
strawberry/utils/typing.py,sha256=SDvX-Du-9HAV3-XXjqi7Q5f5qPDDFd_gASIITiwBQT4,14073
|
239
|
-
strawberry_graphql-0.276.
|
240
|
-
strawberry_graphql-0.276.
|
241
|
-
strawberry_graphql-0.276.
|
242
|
-
strawberry_graphql-0.276.
|
243
|
-
strawberry_graphql-0.276.
|
237
|
+
strawberry_graphql-0.276.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
238
|
+
strawberry_graphql-0.276.1.dist-info/METADATA,sha256=zuUBSbNn5fSZbEJCLzZiEOUou-FA16hqmJQSiAE5ywI,7393
|
239
|
+
strawberry_graphql-0.276.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
240
|
+
strawberry_graphql-0.276.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
241
|
+
strawberry_graphql-0.276.1.dist-info/RECORD,,
|
@@ -1,53 +0,0 @@
|
|
1
|
-
from typing import Union
|
2
|
-
|
3
|
-
from graphql.execution import ExecutionContext as GraphQLExecutionContext
|
4
|
-
from graphql.execution import ExecutionResult as GraphQLExecutionResult
|
5
|
-
from graphql.execution import execute, subscribe
|
6
|
-
|
7
|
-
from strawberry.types import ExecutionResult
|
8
|
-
|
9
|
-
try:
|
10
|
-
from graphql import ( # type: ignore[attr-defined]
|
11
|
-
ExperimentalIncrementalExecutionResults as GraphQLIncrementalExecutionResults,
|
12
|
-
)
|
13
|
-
from graphql.execution import ( # type: ignore[attr-defined]
|
14
|
-
InitialIncrementalExecutionResult,
|
15
|
-
experimental_execute_incrementally,
|
16
|
-
)
|
17
|
-
from graphql.type.directives import ( # type: ignore[attr-defined]
|
18
|
-
GraphQLDeferDirective,
|
19
|
-
GraphQLStreamDirective,
|
20
|
-
)
|
21
|
-
|
22
|
-
incremental_execution_directives = (
|
23
|
-
GraphQLDeferDirective,
|
24
|
-
GraphQLStreamDirective,
|
25
|
-
)
|
26
|
-
|
27
|
-
GraphQLExecutionResult = Union[
|
28
|
-
GraphQLExecutionResult, InitialIncrementalExecutionResult
|
29
|
-
]
|
30
|
-
|
31
|
-
except ImportError:
|
32
|
-
GraphQLIncrementalExecutionResults = type(None)
|
33
|
-
|
34
|
-
incremental_execution_directives = () # type: ignore
|
35
|
-
experimental_execute_incrementally = None
|
36
|
-
|
37
|
-
|
38
|
-
# TODO: give this a better name, maybe also a better place
|
39
|
-
ResultType = Union[
|
40
|
-
GraphQLExecutionResult,
|
41
|
-
GraphQLIncrementalExecutionResults,
|
42
|
-
ExecutionResult,
|
43
|
-
]
|
44
|
-
|
45
|
-
__all__ = [
|
46
|
-
"GraphQLExecutionContext",
|
47
|
-
"GraphQLIncrementalExecutionResults",
|
48
|
-
"ResultType",
|
49
|
-
"execute",
|
50
|
-
"experimental_execute_incrementally",
|
51
|
-
"incremental_execution_directives",
|
52
|
-
"subscribe",
|
53
|
-
]
|
strawberry/streamable.py
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
from collections.abc import AsyncGenerator
|
2
|
-
from typing import Annotated, TypeVar
|
3
|
-
|
4
|
-
|
5
|
-
class StrawberryStreamable: ...
|
6
|
-
|
7
|
-
|
8
|
-
T = TypeVar("T")
|
9
|
-
|
10
|
-
Streamable = Annotated[AsyncGenerator[T, None], StrawberryStreamable()]
|
11
|
-
"""Represents a list that can be streamed using @stream.
|
12
|
-
|
13
|
-
Example:
|
14
|
-
|
15
|
-
```python
|
16
|
-
import strawberry
|
17
|
-
from dataclasses import dataclass
|
18
|
-
|
19
|
-
|
20
|
-
@strawberry.type
|
21
|
-
class Comment:
|
22
|
-
id: strawberry.ID
|
23
|
-
content: str
|
24
|
-
|
25
|
-
|
26
|
-
@strawberry.type
|
27
|
-
class Article:
|
28
|
-
@strawberry.field
|
29
|
-
@staticmethod
|
30
|
-
async def comments() -> strawberry.Streamable[Comment]:
|
31
|
-
for comment in fetch_comments():
|
32
|
-
yield comment
|
33
|
-
```
|
34
|
-
"""
|
35
|
-
|
36
|
-
__all__ = ["Streamable"]
|
{strawberry_graphql-0.276.0.dev1752831589.dist-info → strawberry_graphql-0.276.1.dist-info}/LICENSE
RENAMED
File without changes
|
{strawberry_graphql-0.276.0.dev1752831589.dist-info → strawberry_graphql-0.276.1.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|