strawberry-graphql 0.227.3__py3-none-any.whl → 0.227.5__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/relay/utils.py +22 -5
- strawberry/starlite/controller.py +9 -0
- {strawberry_graphql-0.227.3.dist-info → strawberry_graphql-0.227.5.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.227.3.dist-info → strawberry_graphql-0.227.5.dist-info}/RECORD +7 -7
- {strawberry_graphql-0.227.3.dist-info → strawberry_graphql-0.227.5.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.227.3.dist-info → strawberry_graphql-0.227.5.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.227.3.dist-info → strawberry_graphql-0.227.5.dist-info}/entry_points.txt +0 -0
strawberry/relay/utils.py
CHANGED
@@ -3,7 +3,7 @@ from typing import Any, Tuple, Union
|
|
3
3
|
from typing_extensions import assert_never
|
4
4
|
|
5
5
|
from strawberry.types.info import Info
|
6
|
-
from strawberry.types.nodes import InlineFragment
|
6
|
+
from strawberry.types.nodes import InlineFragment, Selection
|
7
7
|
from strawberry.types.types import StrawberryObjectDefinition
|
8
8
|
|
9
9
|
|
@@ -77,11 +77,28 @@ def should_resolve_list_connection_edges(info: Info) -> bool:
|
|
77
77
|
|
78
78
|
"""
|
79
79
|
resolve_for_field_names = {"edges", "pageInfo"}
|
80
|
+
|
81
|
+
def _check_selection(selection: Selection) -> bool:
|
82
|
+
"""Recursively inspect the selection to check if the user requested to resolve the `edges` field.
|
83
|
+
Args:
|
84
|
+
selection (Selection): The selection to check.
|
85
|
+
|
86
|
+
Returns:
|
87
|
+
bool: True if the user requested to resolve the `edges` field of a connection, False otherwise.
|
88
|
+
"""
|
89
|
+
if (
|
90
|
+
not isinstance(selection, InlineFragment)
|
91
|
+
and selection.name in resolve_for_field_names
|
92
|
+
):
|
93
|
+
return True
|
94
|
+
if selection.selections:
|
95
|
+
return any(
|
96
|
+
_check_selection(selection) for selection in selection.selections
|
97
|
+
)
|
98
|
+
return False
|
99
|
+
|
80
100
|
for selection_field in info.selected_fields:
|
81
101
|
for selection in selection_field.selections:
|
82
|
-
if (
|
83
|
-
not isinstance(selection, InlineFragment)
|
84
|
-
and selection.name in resolve_for_field_names
|
85
|
-
):
|
102
|
+
if _check_selection(selection):
|
86
103
|
return True
|
87
104
|
return False
|
@@ -6,6 +6,7 @@ import warnings
|
|
6
6
|
from dataclasses import dataclass
|
7
7
|
from datetime import timedelta
|
8
8
|
from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Tuple, Union, cast
|
9
|
+
from typing_extensions import deprecated
|
9
10
|
|
10
11
|
from starlite import (
|
11
12
|
BackgroundTasks,
|
@@ -118,6 +119,10 @@ class GraphQLTransportWSHandler(BaseGraphQLTransportWSHandler):
|
|
118
119
|
return await self._get_root_value()
|
119
120
|
|
120
121
|
|
122
|
+
@deprecated(
|
123
|
+
"The `starlite` integration is deprecated in favor of `litestar` integration",
|
124
|
+
stacklevel=2,
|
125
|
+
)
|
121
126
|
class StarliteRequestAdapter(AsyncHTTPRequestAdapter):
|
122
127
|
def __init__(self, request: Request[Any, Any]) -> None:
|
123
128
|
self.request = request
|
@@ -153,6 +158,10 @@ class BaseContext:
|
|
153
158
|
self.response: Optional[Response] = None
|
154
159
|
|
155
160
|
|
161
|
+
@deprecated(
|
162
|
+
"The `starlite` integration is deprecated in favor of `litestar` integration",
|
163
|
+
stacklevel=2,
|
164
|
+
)
|
156
165
|
def make_graphql_controller(
|
157
166
|
schema: BaseSchema,
|
158
167
|
path: str = "",
|
@@ -174,7 +174,7 @@ strawberry/relay/__init__.py,sha256=Vi4btvA_g6Cj9Tk_F9GCSegapIf2WqkOWV8y3P0cTCs,
|
|
174
174
|
strawberry/relay/exceptions.py,sha256=b7sU2MhHVWJOfq27lvqdFcqBZ5P_JWk41JWRjtP-AOI,3916
|
175
175
|
strawberry/relay/fields.py,sha256=0A96V4mQzFJwP9g68tM3zKmbPxnfU2Ix6kbMI-x11LQ,15550
|
176
176
|
strawberry/relay/types.py,sha256=pCFD0UXXofmdTS2wBURjg8KwIfdioMt2j4qNYfk6GqQ,30710
|
177
|
-
strawberry/relay/utils.py,sha256=
|
177
|
+
strawberry/relay/utils.py,sha256=STuJ2j-sTPa70O9juJX21nbhK6yhnHdwiAOWBYKOVdo,3160
|
178
178
|
strawberry/resolvers.py,sha256=g7_g3jmXszziGydY1UG6IItf9s6B1lGLUCnwW1kb8U0,224
|
179
179
|
strawberry/sanic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
180
180
|
strawberry/sanic/context.py,sha256=qfoj8QMaAiWbCQFAdm2KPPJGNc7ilXeKAl5z0XJ2nzo,805
|
@@ -197,7 +197,7 @@ strawberry/schema/types/scalar.py,sha256=SVJ8HiKncCvOw2xwABI5xYaHcC7KkGHG-tx2WDt
|
|
197
197
|
strawberry/schema_codegen/__init__.py,sha256=PcCVXjS0Y5Buxadm07YAZOVunkQ_DmmwsBrgsH1T4ds,24375
|
198
198
|
strawberry/schema_directive.py,sha256=XGKwcsxRpHXJQ_qXXMi1gEXlZOG22SbDf4Phxf4tbQ0,1967
|
199
199
|
strawberry/starlite/__init__.py,sha256=v209swT8H9MljVL-npvANhEO1zz3__PSfxb_Ix-NoeE,134
|
200
|
-
strawberry/starlite/controller.py,sha256=
|
200
|
+
strawberry/starlite/controller.py,sha256=moo2HlaJT6w9AijwjHvXi4UibUydaZfA75JMFZVMJPw,12191
|
201
201
|
strawberry/starlite/handlers/graphql_transport_ws_handler.py,sha256=WhfFVWdjRSk4A48MaBLGWqZdi2OnHajxdQlA_Gc4XBE,1981
|
202
202
|
strawberry/starlite/handlers/graphql_ws_handler.py,sha256=v1RxhvahVazKUg-KXosAcZfv5ap1rEp1A3726d5LkiU,2223
|
203
203
|
strawberry/static/apollo-sandbox.html,sha256=2XzkbE0dqsFHqehE-jul9_J9TFOpwA6Ylrlo0Kdx_9w,973
|
@@ -241,8 +241,8 @@ strawberry/utils/logging.py,sha256=flS7hV0JiIOEdXcrIjda4WyIWix86cpHHFNJL8gl1y4,7
|
|
241
241
|
strawberry/utils/operation.py,sha256=Um-tBCPl3_bVFN2Ph7o1mnrxfxBes4HFCj6T0x4kZxE,1135
|
242
242
|
strawberry/utils/str_converters.py,sha256=avIgPVLg98vZH9mA2lhzVdyyjqzLsK2NdBw9mJQ02Xk,813
|
243
243
|
strawberry/utils/typing.py,sha256=SQVOw1nuFZk2Pe3iz0o8ebzpoyvBVoGSQZVZj6-8k7I,13483
|
244
|
-
strawberry_graphql-0.227.
|
245
|
-
strawberry_graphql-0.227.
|
246
|
-
strawberry_graphql-0.227.
|
247
|
-
strawberry_graphql-0.227.
|
248
|
-
strawberry_graphql-0.227.
|
244
|
+
strawberry_graphql-0.227.5.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
245
|
+
strawberry_graphql-0.227.5.dist-info/METADATA,sha256=yhmiphyIeVU0tpoJFQXaDhDA57to_Ykup2VEQz44B6o,7821
|
246
|
+
strawberry_graphql-0.227.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
247
|
+
strawberry_graphql-0.227.5.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
248
|
+
strawberry_graphql-0.227.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{strawberry_graphql-0.227.3.dist-info → strawberry_graphql-0.227.5.dist-info}/entry_points.txt
RENAMED
File without changes
|