strawberry-graphql 0.231.1__py3-none-any.whl → 0.232.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/extensions/base_extension.py +8 -8
- strawberry/field.py +51 -5
- {strawberry_graphql-0.231.1.dist-info → strawberry_graphql-0.232.1.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.231.1.dist-info → strawberry_graphql-0.232.1.dist-info}/RECORD +7 -7
- {strawberry_graphql-0.231.1.dist-info → strawberry_graphql-0.232.1.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.231.1.dist-info → strawberry_graphql-0.232.1.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.231.1.dist-info → strawberry_graphql-0.232.1.dist-info}/entry_points.txt +0 -0
@@ -24,27 +24,27 @@ class SchemaExtension:
|
|
24
24
|
def __init__(self, *, execution_context: ExecutionContext) -> None:
|
25
25
|
self.execution_context = execution_context
|
26
26
|
|
27
|
-
def on_operation(
|
27
|
+
def on_operation( # type: ignore
|
28
28
|
self,
|
29
|
-
) -> AsyncIteratorOrIterator[None]: # pragma: no cover
|
29
|
+
) -> AsyncIteratorOrIterator[None]: # pragma: no cover
|
30
30
|
"""Called before and after a GraphQL operation (query / mutation) starts"""
|
31
31
|
yield None
|
32
32
|
|
33
|
-
def on_validate(
|
33
|
+
def on_validate( # type: ignore
|
34
34
|
self,
|
35
|
-
) -> AsyncIteratorOrIterator[None]: # pragma: no cover
|
35
|
+
) -> AsyncIteratorOrIterator[None]: # pragma: no cover
|
36
36
|
"""Called before and after the validation step"""
|
37
37
|
yield None
|
38
38
|
|
39
|
-
def on_parse(
|
39
|
+
def on_parse( # type: ignore
|
40
40
|
self,
|
41
|
-
) -> AsyncIteratorOrIterator[None]: # pragma: no cover
|
41
|
+
) -> AsyncIteratorOrIterator[None]: # pragma: no cover
|
42
42
|
"""Called before and after the parsing step"""
|
43
43
|
yield None
|
44
44
|
|
45
|
-
def on_execute(
|
45
|
+
def on_execute( # type: ignore
|
46
46
|
self,
|
47
|
-
) -> AsyncIteratorOrIterator[None]: # pragma: no cover
|
47
|
+
) -> AsyncIteratorOrIterator[None]: # pragma: no cover
|
48
48
|
"""Called before and after the execution step"""
|
49
49
|
yield None
|
50
50
|
|
strawberry/field.py
CHANGED
@@ -46,15 +46,20 @@ if TYPE_CHECKING:
|
|
46
46
|
|
47
47
|
T = TypeVar("T")
|
48
48
|
|
49
|
-
|
49
|
+
_RESOLVER_TYPE_SYNC = Union[
|
50
50
|
StrawberryResolver[T],
|
51
51
|
Callable[..., T],
|
52
|
-
Callable[..., Coroutine[T, Any, Any]],
|
53
|
-
Callable[..., Awaitable[T]],
|
54
52
|
"staticmethod[Any, T]",
|
55
53
|
"classmethod[Any, Any, T]",
|
56
54
|
]
|
57
55
|
|
56
|
+
_RESOLVER_TYPE_ASYNC = Union[
|
57
|
+
Callable[..., Coroutine[Any, Any, T]],
|
58
|
+
Callable[..., Awaitable[T]],
|
59
|
+
]
|
60
|
+
|
61
|
+
_RESOLVER_TYPE = Union[_RESOLVER_TYPE_SYNC[T], _RESOLVER_TYPE_ASYNC[T]]
|
62
|
+
|
58
63
|
UNRESOLVED = object()
|
59
64
|
|
60
65
|
|
@@ -416,10 +421,33 @@ class StrawberryField(dataclasses.Field):
|
|
416
421
|
return self._has_async_base_resolver
|
417
422
|
|
418
423
|
|
424
|
+
# NOTE: we are separating the sync and async resolvers because using both
|
425
|
+
# in the same function will cause mypy to raise an error. Not sure if it is a bug
|
426
|
+
|
427
|
+
|
428
|
+
@overload
|
429
|
+
def field(
|
430
|
+
*,
|
431
|
+
resolver: _RESOLVER_TYPE_ASYNC[T],
|
432
|
+
name: Optional[str] = None,
|
433
|
+
is_subscription: bool = False,
|
434
|
+
description: Optional[str] = None,
|
435
|
+
init: Literal[False] = False,
|
436
|
+
permission_classes: Optional[List[Type[BasePermission]]] = None,
|
437
|
+
deprecation_reason: Optional[str] = None,
|
438
|
+
default: Any = dataclasses.MISSING,
|
439
|
+
default_factory: Union[Callable[..., object], object] = dataclasses.MISSING,
|
440
|
+
metadata: Optional[Mapping[Any, Any]] = None,
|
441
|
+
directives: Optional[Sequence[object]] = (),
|
442
|
+
extensions: Optional[List[FieldExtension]] = None,
|
443
|
+
graphql_type: Optional[Any] = None,
|
444
|
+
) -> T: ...
|
445
|
+
|
446
|
+
|
419
447
|
@overload
|
420
448
|
def field(
|
421
449
|
*,
|
422
|
-
resolver:
|
450
|
+
resolver: _RESOLVER_TYPE_SYNC[T],
|
423
451
|
name: Optional[str] = None,
|
424
452
|
is_subscription: bool = False,
|
425
453
|
description: Optional[str] = None,
|
@@ -455,7 +483,25 @@ def field(
|
|
455
483
|
|
456
484
|
@overload
|
457
485
|
def field(
|
458
|
-
resolver:
|
486
|
+
resolver: _RESOLVER_TYPE_ASYNC[T],
|
487
|
+
*,
|
488
|
+
name: Optional[str] = None,
|
489
|
+
is_subscription: bool = False,
|
490
|
+
description: Optional[str] = None,
|
491
|
+
permission_classes: Optional[List[Type[BasePermission]]] = None,
|
492
|
+
deprecation_reason: Optional[str] = None,
|
493
|
+
default: Any = dataclasses.MISSING,
|
494
|
+
default_factory: Union[Callable[..., object], object] = dataclasses.MISSING,
|
495
|
+
metadata: Optional[Mapping[Any, Any]] = None,
|
496
|
+
directives: Optional[Sequence[object]] = (),
|
497
|
+
extensions: Optional[List[FieldExtension]] = None,
|
498
|
+
graphql_type: Optional[Any] = None,
|
499
|
+
) -> StrawberryField: ...
|
500
|
+
|
501
|
+
|
502
|
+
@overload
|
503
|
+
def field(
|
504
|
+
resolver: _RESOLVER_TYPE_SYNC[T],
|
459
505
|
*,
|
460
506
|
name: Optional[str] = None,
|
461
507
|
is_subscription: bool = False,
|
@@ -100,7 +100,7 @@ strawberry/ext/dataclasses/dataclasses.py,sha256=Le32f96qmahuenVsMW5xjIr-EPnO7WK
|
|
100
100
|
strawberry/ext/mypy_plugin.py,sha256=iqqRtJk3YRt1-rxDDl7aa9QtxZ0QYcu9-o6OWaczkqo,19716
|
101
101
|
strawberry/extensions/__init__.py,sha256=SZ-YEMnxAzoDZFo-uHXMHOaY_PPkYm1muPpK4ccJ3Xk,1248
|
102
102
|
strawberry/extensions/add_validation_rules.py,sha256=l1cCl6VGQ8c2EELK3cIjmn6RftonHD1jKoWQ5-hMTf0,1366
|
103
|
-
strawberry/extensions/base_extension.py,sha256=
|
103
|
+
strawberry/extensions/base_extension.py,sha256=_IS5rM8QNAvptQAem65LZqZ2zdGt2nCw_VjlBQ44ZUg,1992
|
104
104
|
strawberry/extensions/context.py,sha256=j2pxKnZ8HOgugm_P_YJV6Fbp_SXkS-U5OLQvn-ofjRM,7210
|
105
105
|
strawberry/extensions/directives.py,sha256=ulS80mDTDE-pM8d9IEk16O84kzjkXM1P4vMcqYp5Q1U,2968
|
106
106
|
strawberry/extensions/disable_validation.py,sha256=GL_rYvoDrAry1Po6vXCdhi7H8iG1Un0okGTcnC0M9us,728
|
@@ -138,7 +138,7 @@ strawberry/federation/schema_directive.py,sha256=V_8ytK_cbVoVRhFle0o9DTQkrP1k-xw
|
|
138
138
|
strawberry/federation/schema_directives.py,sha256=Awb-BqICDptYtDNRF3BUNnbNcrsSTDN8AWAwKxVZ3UQ,6139
|
139
139
|
strawberry/federation/types.py,sha256=mM70g1aLgjplOc3SdtuJjy7NAKFLv35Z4BDC4s_j5us,301
|
140
140
|
strawberry/federation/union.py,sha256=QXeh-nhApqFtXa3To9MX_IwvtwErZBhWYnssUK7JB2E,1005
|
141
|
-
strawberry/field.py,sha256=
|
141
|
+
strawberry/field.py,sha256=jUOchyxLXmTzatazPF-gDjn4iTizC5XhjD-kPcs8mxE,20448
|
142
142
|
strawberry/field_extensions/__init__.py,sha256=0z6RG9jEO7jpAuyEaQhRI5A_30rdcvsBM0qMhLs8y2s,96
|
143
143
|
strawberry/field_extensions/input_mutation.py,sha256=a2zK97Fc5biqBt2ZlUPEPTQgMTRx6sJCSd3hSsjLSxI,2650
|
144
144
|
strawberry/file_uploads/__init__.py,sha256=v2-6FGBqnTnMPSUTFOiXpIutDMl-ga0PFtw5tKlcagk,50
|
@@ -245,8 +245,8 @@ strawberry/utils/logging.py,sha256=flS7hV0JiIOEdXcrIjda4WyIWix86cpHHFNJL8gl1y4,7
|
|
245
245
|
strawberry/utils/operation.py,sha256=Um-tBCPl3_bVFN2Ph7o1mnrxfxBes4HFCj6T0x4kZxE,1135
|
246
246
|
strawberry/utils/str_converters.py,sha256=avIgPVLg98vZH9mA2lhzVdyyjqzLsK2NdBw9mJQ02Xk,813
|
247
247
|
strawberry/utils/typing.py,sha256=K31YP0DftNDBhsk1yhW0BmYoEegU8nWOD26dvkRx2Xo,13717
|
248
|
-
strawberry_graphql-0.
|
249
|
-
strawberry_graphql-0.
|
250
|
-
strawberry_graphql-0.
|
251
|
-
strawberry_graphql-0.
|
252
|
-
strawberry_graphql-0.
|
248
|
+
strawberry_graphql-0.232.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
249
|
+
strawberry_graphql-0.232.1.dist-info/METADATA,sha256=zs5gzLUQ06x4a7CAzFkphdMYnkywuMQ3R9K2hQ8lPkE,7821
|
250
|
+
strawberry_graphql-0.232.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
251
|
+
strawberry_graphql-0.232.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
252
|
+
strawberry_graphql-0.232.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{strawberry_graphql-0.231.1.dist-info → strawberry_graphql-0.232.1.dist-info}/entry_points.txt
RENAMED
File without changes
|