strawberry-graphql 0.240.4__py3-none-any.whl → 0.241.0__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/directives.py +3 -2
- strawberry/schema/config.py +6 -0
- strawberry/schema/schema_converter.py +2 -2
- {strawberry_graphql-0.240.4.dist-info → strawberry_graphql-0.241.0.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.240.4.dist-info → strawberry_graphql-0.241.0.dist-info}/RECORD +8 -8
- {strawberry_graphql-0.240.4.dist-info → strawberry_graphql-0.241.0.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.240.4.dist-info → strawberry_graphql-0.241.0.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.240.4.dist-info → strawberry_graphql-0.241.0.dist-info}/entry_points.txt +0 -0
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|
3
3
|
from typing import TYPE_CHECKING, Any, Callable, Dict, Tuple
|
4
4
|
|
5
5
|
from strawberry.extensions import SchemaExtension
|
6
|
-
from strawberry.types import Info
|
7
6
|
from strawberry.types.nodes import convert_arguments
|
8
7
|
from strawberry.utils.await_maybe import await_maybe
|
9
8
|
|
@@ -81,7 +80,9 @@ def process_directive(
|
|
81
80
|
field_name=info.field_name,
|
82
81
|
type_name=info.parent_type.name,
|
83
82
|
)
|
84
|
-
arguments[info_parameter.name] =
|
83
|
+
arguments[info_parameter.name] = schema.config.info_class(
|
84
|
+
_raw_info=info, _field=field
|
85
|
+
)
|
85
86
|
if value_parameter:
|
86
87
|
arguments[value_parameter.name] = value
|
87
88
|
return strawberry_directive, arguments
|
strawberry/schema/config.py
CHANGED
@@ -3,6 +3,8 @@ from __future__ import annotations
|
|
3
3
|
from dataclasses import InitVar, dataclass, field
|
4
4
|
from typing import Any, Callable
|
5
5
|
|
6
|
+
from strawberry.types.info import Info
|
7
|
+
|
6
8
|
from .name_converter import NameConverter
|
7
9
|
|
8
10
|
|
@@ -13,6 +15,7 @@ class StrawberryConfig:
|
|
13
15
|
default_resolver: Callable[[Any, str], object] = getattr
|
14
16
|
relay_max_results: int = 100
|
15
17
|
disable_field_suggestions: bool = False
|
18
|
+
info_class: type[Info] = Info
|
16
19
|
|
17
20
|
def __post_init__(
|
18
21
|
self,
|
@@ -21,5 +24,8 @@ class StrawberryConfig:
|
|
21
24
|
if auto_camel_case is not None:
|
22
25
|
self.name_converter.auto_camel_case = auto_camel_case
|
23
26
|
|
27
|
+
if not issubclass(self.info_class, Info):
|
28
|
+
raise TypeError("`info_class` must be a subclass of strawberry.Info")
|
29
|
+
|
24
30
|
|
25
31
|
__all__ = ["StrawberryConfig"]
|
@@ -64,7 +64,6 @@ from strawberry.types.base import (
|
|
64
64
|
)
|
65
65
|
from strawberry.types.enum import EnumDefinition
|
66
66
|
from strawberry.types.field import UNRESOLVED
|
67
|
-
from strawberry.types.info import Info
|
68
67
|
from strawberry.types.lazy_type import LazyType
|
69
68
|
from strawberry.types.private import is_private
|
70
69
|
from strawberry.types.scalar import ScalarWrapper
|
@@ -90,6 +89,7 @@ if TYPE_CHECKING:
|
|
90
89
|
from strawberry.schema_directive import StrawberrySchemaDirective
|
91
90
|
from strawberry.types.enum import EnumValue
|
92
91
|
from strawberry.types.field import StrawberryField
|
92
|
+
from strawberry.types.info import Info
|
93
93
|
from strawberry.types.scalar import ScalarDefinition
|
94
94
|
|
95
95
|
|
@@ -664,7 +664,7 @@ class GraphQLCoreConverter:
|
|
664
664
|
return _get_basic_result
|
665
665
|
|
666
666
|
def _strawberry_info_from_graphql(info: GraphQLResolveInfo) -> Info:
|
667
|
-
return
|
667
|
+
return self.config.info_class(
|
668
668
|
_raw_info=info,
|
669
669
|
_field=field,
|
670
670
|
)
|
@@ -100,7 +100,7 @@ strawberry/extensions/__init__.py,sha256=SZ-YEMnxAzoDZFo-uHXMHOaY_PPkYm1muPpK4cc
|
|
100
100
|
strawberry/extensions/add_validation_rules.py,sha256=abkOaXG-unAZj2xL2sspeUXpZKBCpj5Kr5h7TreN4gM,1338
|
101
101
|
strawberry/extensions/base_extension.py,sha256=Wf-Xu38lPXXBPuhsxpMi18yL5oH0uoskPhs08hfSYXg,2362
|
102
102
|
strawberry/extensions/context.py,sha256=j2pxKnZ8HOgugm_P_YJV6Fbp_SXkS-U5OLQvn-ofjRM,7210
|
103
|
-
strawberry/extensions/directives.py,sha256=
|
103
|
+
strawberry/extensions/directives.py,sha256=5L6vSXbVuEjSSolKLE7LLfSejJyJhyhwDJgQ8HfTeVA,3045
|
104
104
|
strawberry/extensions/disable_validation.py,sha256=wupc5zATOLyZmay14WI-FKaPZo0jj23hv8_4H3jvbMQ,741
|
105
105
|
strawberry/extensions/field_extension.py,sha256=PHsb1ctvyrjOmgWVQdABFDAlnPYsalExYM7jYu5VPVg,5740
|
106
106
|
strawberry/extensions/mask_errors.py,sha256=Khfun5JtrU57rhnP2Sxsl8Q6Eo70GYoQcn9sPDLg4nY,1460
|
@@ -180,12 +180,12 @@ strawberry/scalars.py,sha256=c3y8EOmX-KUxSgRqk1TNercMA6_rgBHhQPp0z3C2zBU,2240
|
|
180
180
|
strawberry/schema/__init__.py,sha256=u1QCyDVQExUVDA20kyosKPz3TS5HMCN2NrXclhiFAL4,92
|
181
181
|
strawberry/schema/base.py,sha256=yarj62fhfCp0kToJPpWlNcCjyZV2CafbfpZ-yamjNVg,3730
|
182
182
|
strawberry/schema/compat.py,sha256=rRqUm5-XgPXC018_u0Mrd4iad7tTRCNA45Ko4NaT6gk,1836
|
183
|
-
strawberry/schema/config.py,sha256=
|
183
|
+
strawberry/schema/config.py,sha256=6BpCbNNCuekGgiKEPt2mliMqLH_wIjJmSW0tLbnJwk4,924
|
184
184
|
strawberry/schema/exceptions.py,sha256=rqVNb_oYrKM0dHPgvAemqCG6Um282LPPu4zwQ5cZqs4,584
|
185
185
|
strawberry/schema/execute.py,sha256=EWNmu3hvlZMV2EWi8IbWVLUQYRH45AFB68DrOnx3BEI,11913
|
186
186
|
strawberry/schema/name_converter.py,sha256=tpqw2XCSFvJI-H844iWhE2Z1sKic7DrjIZxt11eJN5Y,6574
|
187
187
|
strawberry/schema/schema.py,sha256=rdsZrnAZZDV_eU_9s2K21hgROtP29GRt5MjUrwVBwyE,19034
|
188
|
-
strawberry/schema/schema_converter.py,sha256=
|
188
|
+
strawberry/schema/schema_converter.py,sha256=znAKbouf_Vh5sXMhuxSABAatZ7HrvM3gONAZkjPMeDE,36881
|
189
189
|
strawberry/schema/subscribe.py,sha256=wg-U2S-SrHxvtJA9KttnBQnyUOh-qy7UaPjumNk2Czw,6007
|
190
190
|
strawberry/schema/types/__init__.py,sha256=oHO3COWhL3L1KLYCJNY1XFf5xt2GGtHiMC-UaYbFfnA,68
|
191
191
|
strawberry/schema/types/base_scalars.py,sha256=NTj_tYqWLQLEOPDhBhSE1My4JXoieyg0jO8B6RNK-xA,1913
|
@@ -245,8 +245,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
|
|
245
245
|
strawberry/utils/operation.py,sha256=SSXxN-vMqdHO6W2OZtip-1z7y4_A-eTVFdhDvhKeLCk,1193
|
246
246
|
strawberry/utils/str_converters.py,sha256=KGd7QH90RevaJjH6SQEkiVVsb8KuhJr_wv5AsI7UzQk,897
|
247
247
|
strawberry/utils/typing.py,sha256=3xws5kxSQGsp8BnYyUwClvxXNzZakMAuOPoq1rjHRuk,14252
|
248
|
-
strawberry_graphql-0.
|
249
|
-
strawberry_graphql-0.
|
250
|
-
strawberry_graphql-0.
|
251
|
-
strawberry_graphql-0.
|
252
|
-
strawberry_graphql-0.
|
248
|
+
strawberry_graphql-0.241.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
249
|
+
strawberry_graphql-0.241.0.dist-info/METADATA,sha256=ZSvM67VyfBvf-dDf8uoTlYpPa0KL4_bBBmTIt4js4x8,7707
|
250
|
+
strawberry_graphql-0.241.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
251
|
+
strawberry_graphql-0.241.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
252
|
+
strawberry_graphql-0.241.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{strawberry_graphql-0.240.4.dist-info → strawberry_graphql-0.241.0.dist-info}/entry_points.txt
RENAMED
File without changes
|