strawberry-graphql 0.251.0__py3-none-any.whl → 0.252.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/aiohttp/views.py +2 -2
- strawberry/asgi/__init__.py +3 -2
- strawberry/channels/handlers/ws_handler.py +2 -3
- strawberry/http/async_base_view.py +1 -1
- strawberry/http/base.py +4 -1
- strawberry/litestar/controller.py +2 -2
- {strawberry_graphql-0.251.0.dist-info → strawberry_graphql-0.252.0.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.251.0.dist-info → strawberry_graphql-0.252.0.dist-info}/RECORD +11 -11
- {strawberry_graphql-0.251.0.dist-info → strawberry_graphql-0.252.0.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.251.0.dist-info → strawberry_graphql-0.252.0.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.251.0.dist-info → strawberry_graphql-0.252.0.dist-info}/entry_points.txt +0 -0
strawberry/aiohttp/views.py
CHANGED
@@ -96,11 +96,11 @@ class AioHTTPWebSocketAdapter(AsyncWebSocketAdapter):
|
|
96
96
|
|
97
97
|
async def iter_json(
|
98
98
|
self, *, ignore_parsing_errors: bool = False
|
99
|
-
) -> AsyncGenerator[
|
99
|
+
) -> AsyncGenerator[object, None]:
|
100
100
|
async for ws_message in self.ws:
|
101
101
|
if ws_message.type == http.WSMsgType.TEXT:
|
102
102
|
try:
|
103
|
-
yield ws_message.
|
103
|
+
yield self.view.decode_json(ws_message.data)
|
104
104
|
except JSONDecodeError:
|
105
105
|
if not ignore_parsing_errors:
|
106
106
|
raise NonJsonMessageReceived()
|
strawberry/asgi/__init__.py
CHANGED
@@ -95,11 +95,12 @@ class ASGIWebSocketAdapter(AsyncWebSocketAdapter):
|
|
95
95
|
|
96
96
|
async def iter_json(
|
97
97
|
self, *, ignore_parsing_errors: bool = False
|
98
|
-
) -> AsyncGenerator[
|
98
|
+
) -> AsyncGenerator[object, None]:
|
99
99
|
try:
|
100
100
|
while self.ws.application_state != WebSocketState.DISCONNECTED:
|
101
101
|
try:
|
102
|
-
|
102
|
+
text = await self.ws.receive_text()
|
103
|
+
yield self.view.decode_json(text)
|
103
104
|
except JSONDecodeError: # noqa: PERF203
|
104
105
|
if not ignore_parsing_errors:
|
105
106
|
raise NonJsonMessageReceived()
|
@@ -6,7 +6,6 @@ import json
|
|
6
6
|
from typing import (
|
7
7
|
TYPE_CHECKING,
|
8
8
|
AsyncGenerator,
|
9
|
-
Dict,
|
10
9
|
Mapping,
|
11
10
|
Optional,
|
12
11
|
Tuple,
|
@@ -39,7 +38,7 @@ class ChannelsWebSocketAdapter(AsyncWebSocketAdapter):
|
|
39
38
|
|
40
39
|
async def iter_json(
|
41
40
|
self, *, ignore_parsing_errors: bool = False
|
42
|
-
) -> AsyncGenerator[
|
41
|
+
) -> AsyncGenerator[object, None]:
|
43
42
|
while True:
|
44
43
|
message = await self.ws_consumer.message_queue.get()
|
45
44
|
|
@@ -50,7 +49,7 @@ class ChannelsWebSocketAdapter(AsyncWebSocketAdapter):
|
|
50
49
|
raise NonTextMessageReceived()
|
51
50
|
|
52
51
|
try:
|
53
|
-
yield
|
52
|
+
yield self.view.decode_json(message["message"])
|
54
53
|
except json.JSONDecodeError:
|
55
54
|
if not ignore_parsing_errors:
|
56
55
|
raise NonJsonMessageReceived()
|
@@ -86,7 +86,7 @@ class AsyncWebSocketAdapter(abc.ABC):
|
|
86
86
|
@abc.abstractmethod
|
87
87
|
def iter_json(
|
88
88
|
self, *, ignore_parsing_errors: bool = False
|
89
|
-
) -> AsyncGenerator[
|
89
|
+
) -> AsyncGenerator[object, None]: ...
|
90
90
|
|
91
91
|
@abc.abstractmethod
|
92
92
|
async def send_json(self, message: Mapping[str, object]) -> None: ...
|
strawberry/http/base.py
CHANGED
@@ -39,10 +39,13 @@ class BaseView(Generic[Request]):
|
|
39
39
|
|
40
40
|
def parse_json(self, data: Union[str, bytes]) -> Any:
|
41
41
|
try:
|
42
|
-
return
|
42
|
+
return self.decode_json(data)
|
43
43
|
except json.JSONDecodeError as e:
|
44
44
|
raise HTTPException(400, "Unable to parse request body as JSON") from e
|
45
45
|
|
46
|
+
def decode_json(self, data: Union[str, bytes]) -> object:
|
47
|
+
return json.loads(data)
|
48
|
+
|
46
49
|
def encode_json(self, data: object) -> str:
|
47
50
|
return json.dumps(data)
|
48
51
|
|
@@ -202,7 +202,7 @@ class LitestarWebSocketAdapter(AsyncWebSocketAdapter):
|
|
202
202
|
|
203
203
|
async def iter_json(
|
204
204
|
self, *, ignore_parsing_errors: bool = False
|
205
|
-
) -> AsyncGenerator[
|
205
|
+
) -> AsyncGenerator[object, None]:
|
206
206
|
try:
|
207
207
|
while self.ws.connection_state != "disconnect":
|
208
208
|
text = await self.ws.receive_text()
|
@@ -212,7 +212,7 @@ class LitestarWebSocketAdapter(AsyncWebSocketAdapter):
|
|
212
212
|
raise NonTextMessageReceived()
|
213
213
|
|
214
214
|
try:
|
215
|
-
yield
|
215
|
+
yield self.view.decode_json(text)
|
216
216
|
except json.JSONDecodeError:
|
217
217
|
if not ignore_parsing_errors:
|
218
218
|
raise NonJsonMessageReceived()
|
@@ -3,9 +3,9 @@ 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=xPwOo1V0XbC86LWHiSRTLcGNOa796flz49wzWmdkvSs,1775
|
6
|
-
strawberry/aiohttp/views.py,sha256
|
6
|
+
strawberry/aiohttp/views.py,sha256=q0L5JwIk-8TTnyy_4nfmBIve3DHnRb8YwOBP4qmvDLE,7867
|
7
7
|
strawberry/annotation.py,sha256=u5rkFs6CDUaiJZMK7jp_VDUWdZZ3HXQEbR2ocruDpxA,13065
|
8
|
-
strawberry/asgi/__init__.py,sha256=
|
8
|
+
strawberry/asgi/__init__.py,sha256=Pixb9ldPltXl-TChhF6zkmiyjxol-zu8PPmfWeDqExA,8130
|
9
9
|
strawberry/asgi/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
|
10
10
|
strawberry/asgi/test/client.py,sha256=VolupxMna9ktF1lYgV_dUQAIN53DNzVyWTeWTbwsxqE,1448
|
11
11
|
strawberry/chalice/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -14,7 +14,7 @@ strawberry/channels/__init__.py,sha256=-9ENTIu1AILbqffJ663qH6AwpZgLrJx_kaokS7RrC
|
|
14
14
|
strawberry/channels/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
15
|
strawberry/channels/handlers/base.py,sha256=KV4KA0eF5NRtikV9m4ssoPI5pmCZvDuRkfoTxwh42qI,7853
|
16
16
|
strawberry/channels/handlers/http_handler.py,sha256=fnQcPwdUz2CboVlnI3s1urQ_ZnZyNZvRx7SM_xPLLEA,11577
|
17
|
-
strawberry/channels/handlers/ws_handler.py,sha256=
|
17
|
+
strawberry/channels/handlers/ws_handler.py,sha256=_oTCfu2LYczBNVqFxbChGU-4weix86pHcFphFz3CYQg,6148
|
18
18
|
strawberry/channels/router.py,sha256=DKIbl4zuRBhfvViUVpyu0Rf_WRT41E6uZC-Yic9Ltvo,2024
|
19
19
|
strawberry/channels/testing.py,sha256=0q7XQi3uOa-WbqXTkZKWwsLH2B8IHfP3JAXF-b-1qM4,6490
|
20
20
|
strawberry/cli/__init__.py,sha256=byS5VrEiTJatAH6YS4V1Kd4SOwMRAQO2M1oJdIddivg,585
|
@@ -131,8 +131,8 @@ strawberry/file_uploads/utils.py,sha256=2zsXg3QsKgGLD7of2dW-vgQn_Naf7I3Men9PhEAF
|
|
131
131
|
strawberry/flask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
132
132
|
strawberry/flask/views.py,sha256=3gd1Xgxg3IT72dz2nrMBK094dMNxTUHciu3oofGOAG4,6235
|
133
133
|
strawberry/http/__init__.py,sha256=GSvHUDXl1cHfLnb37PXOAnxfoXhvz0f467P1O8uDatM,1620
|
134
|
-
strawberry/http/async_base_view.py,sha256=
|
135
|
-
strawberry/http/base.py,sha256=
|
134
|
+
strawberry/http/async_base_view.py,sha256=prPO8MfNwPjoOIEQLHkC-miL-mprg7XYcrJI4JBYTbs,15852
|
135
|
+
strawberry/http/base.py,sha256=rfOH64-_b040YWRwqTCCA3ALjPoGxc110rmCxqfS4M4,2358
|
136
136
|
strawberry/http/exceptions.py,sha256=9E2dreS1crRoJVUEPuHyx23NcDELDHNzkAOa-rGv-8I,348
|
137
137
|
strawberry/http/ides.py,sha256=njYI2b5R0PnY27ll1ePdIvgPQU3m6Aod_JTBrcZYs0U,638
|
138
138
|
strawberry/http/parse_content_type.py,sha256=sgtcOO_ZOFg7WWWibYyLc4SU58K-SErcW56kQczQmKU,412
|
@@ -141,7 +141,7 @@ strawberry/http/temporal_response.py,sha256=QrGYSg7Apu7Mh-X_uPKDZby-UicXw2J_ywxa
|
|
141
141
|
strawberry/http/types.py,sha256=cAuaiUuvaMI_XhZ2Ey6Ej23WyQKqMGFxzzpVHDjVazY,371
|
142
142
|
strawberry/http/typevars.py,sha256=8hK5PfNPZXb2EhZmqlobYyfwJJcO2Wb96T91MlLEVJs,450
|
143
143
|
strawberry/litestar/__init__.py,sha256=zsXzg-mglCGUVO9iNXLm-yadoDSCK7k-zuyRqyvAh1w,237
|
144
|
-
strawberry/litestar/controller.py,sha256=
|
144
|
+
strawberry/litestar/controller.py,sha256=5F7J0mbVzyDJCP1MJFpDp3kS6b82xrN33DA9ONHEOLs,14090
|
145
145
|
strawberry/parent.py,sha256=sXURm0lauSpjUADsmfNGY-Zl7kHs0A67BFcWuWKzRxw,771
|
146
146
|
strawberry/permission.py,sha256=rCJLK21cRNDQ6N9eSqcEiIUZiuCvF3FVOK3onXGai9E,7543
|
147
147
|
strawberry/printer/__init__.py,sha256=DmepjmgtkdF5RxK_7yC6qUyRWn56U-9qeZMbkztYB9w,62
|
@@ -229,8 +229,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
|
|
229
229
|
strawberry/utils/operation.py,sha256=SSXxN-vMqdHO6W2OZtip-1z7y4_A-eTVFdhDvhKeLCk,1193
|
230
230
|
strawberry/utils/str_converters.py,sha256=KGd7QH90RevaJjH6SQEkiVVsb8KuhJr_wv5AsI7UzQk,897
|
231
231
|
strawberry/utils/typing.py,sha256=G6k2wWD1TDQ9WFk-Togekj_hTVFqHV-g7Phf2Wu41ms,14380
|
232
|
-
strawberry_graphql-0.
|
233
|
-
strawberry_graphql-0.
|
234
|
-
strawberry_graphql-0.
|
235
|
-
strawberry_graphql-0.
|
236
|
-
strawberry_graphql-0.
|
232
|
+
strawberry_graphql-0.252.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
233
|
+
strawberry_graphql-0.252.0.dist-info/METADATA,sha256=mMPtQtkqL-J5eRrC7agzkiowJdN2Ld-mXt0MW5_28Nc,7758
|
234
|
+
strawberry_graphql-0.252.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
235
|
+
strawberry_graphql-0.252.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
236
|
+
strawberry_graphql-0.252.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{strawberry_graphql-0.251.0.dist-info → strawberry_graphql-0.252.0.dist-info}/entry_points.txt
RENAMED
File without changes
|