strawberry-graphql 0.280.0__py3-none-any.whl → 0.281.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.

Potentially problematic release.


This version of strawberry-graphql might be problematic. Click here for more details.

@@ -97,7 +97,6 @@ class GraphQLView(
97
97
  allow_queries_via_get: bool = True,
98
98
  keep_alive: bool = True,
99
99
  keep_alive_interval: float = 1,
100
- debug: bool = False,
101
100
  subscription_protocols: Sequence[str] = (
102
101
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
103
102
  GRAPHQL_WS_PROTOCOL,
@@ -109,7 +108,6 @@ class GraphQLView(
109
108
  self.allow_queries_via_get = allow_queries_via_get
110
109
  self.keep_alive = keep_alive
111
110
  self.keep_alive_interval = keep_alive_interval
112
- self.debug = debug
113
111
  self.subscription_protocols = subscription_protocols
114
112
  self.connection_init_wait_timeout = connection_init_wait_timeout
115
113
  self.multipart_uploads_enabled = multipart_uploads_enabled
@@ -103,7 +103,6 @@ class GraphQL(
103
103
  allow_queries_via_get: bool = True,
104
104
  keep_alive: bool = False,
105
105
  keep_alive_interval: float = 1,
106
- debug: bool = False,
107
106
  subscription_protocols: Sequence[str] = (
108
107
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
109
108
  GRAPHQL_WS_PROTOCOL,
@@ -115,7 +114,6 @@ class GraphQL(
115
114
  self.allow_queries_via_get = allow_queries_via_get
116
115
  self.keep_alive = keep_alive
117
116
  self.keep_alive_interval = keep_alive_interval
118
- self.debug = debug
119
117
  self.protocols = subscription_protocols
120
118
  self.connection_init_wait_timeout = connection_init_wait_timeout
121
119
  self.multipart_uploads_enabled = multipart_uploads_enabled
@@ -109,7 +109,6 @@ class GraphQLWSConsumer(
109
109
  schema: BaseSchema,
110
110
  keep_alive: bool = False,
111
111
  keep_alive_interval: float = 1,
112
- debug: bool = False,
113
112
  subscription_protocols: Sequence[str] = (
114
113
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
115
114
  GRAPHQL_WS_PROTOCOL,
@@ -122,7 +121,6 @@ class GraphQLWSConsumer(
122
121
  self.schema = schema
123
122
  self.keep_alive = keep_alive
124
123
  self.keep_alive_interval = keep_alive_interval
125
- self.debug = debug
126
124
  self.protocols = subscription_protocols
127
125
  self.message_queue: asyncio.Queue[MessageQueueData] = asyncio.Queue()
128
126
  self.run_task: Optional[asyncio.Task] = None
@@ -6,10 +6,7 @@ import rich
6
6
  import typer
7
7
 
8
8
  from strawberry.cli.app import app
9
- from strawberry.cli.constants import (
10
- DEBUG_SERVER_LOG_OPERATIONS,
11
- DEBUG_SERVER_SCHEMA_ENV_VAR_KEY,
12
- )
9
+ from strawberry.cli.constants import DEBUG_SERVER_SCHEMA_ENV_VAR_KEY
13
10
  from strawberry.cli.utils import load_schema
14
11
 
15
12
 
@@ -42,12 +39,6 @@ def server(
42
39
  "Works the same as `--app-dir` in uvicorn."
43
40
  ),
44
41
  ),
45
- log_operations: bool = typer.Option(
46
- True,
47
- "--log-operations",
48
- show_default=True,
49
- help="Log GraphQL operations",
50
- ),
51
42
  ) -> None:
52
43
  sys.path.insert(0, app_dir)
53
44
 
@@ -65,7 +56,6 @@ def server(
65
56
  load_schema(schema, app_dir=app_dir)
66
57
 
67
58
  os.environ[DEBUG_SERVER_SCHEMA_ENV_VAR_KEY] = schema
68
- os.environ[DEBUG_SERVER_LOG_OPERATIONS] = str(log_operations)
69
59
  app = "strawberry.cli.debug_server:app"
70
60
 
71
61
  # Windows doesn't support UTF-8 by default
@@ -1,2 +1 @@
1
1
  DEBUG_SERVER_SCHEMA_ENV_VAR_KEY = "STRAWBERRY_DEBUG_SERVER_SCHEMA"
2
- DEBUG_SERVER_LOG_OPERATIONS = "STRAWBERRY_DEBUG_SERVER_LOG_OPERATIONS"
@@ -6,10 +6,7 @@ from starlette.middleware.cors import CORSMiddleware
6
6
 
7
7
  from strawberry import Schema
8
8
  from strawberry.asgi import GraphQL
9
- from strawberry.cli.constants import (
10
- DEBUG_SERVER_LOG_OPERATIONS,
11
- DEBUG_SERVER_SCHEMA_ENV_VAR_KEY,
12
- )
9
+ from strawberry.cli.constants import DEBUG_SERVER_SCHEMA_ENV_VAR_KEY
13
10
  from strawberry.utils.importer import import_module_symbol
14
11
 
15
12
  app = Starlette(debug=True)
@@ -19,10 +16,9 @@ app.add_middleware(
19
16
 
20
17
  schema_import_string = os.environ[DEBUG_SERVER_SCHEMA_ENV_VAR_KEY]
21
18
  schema_symbol = import_module_symbol(schema_import_string, default_symbol_name="schema")
22
- log_operations = os.environ[DEBUG_SERVER_LOG_OPERATIONS] == "True"
23
19
 
24
20
  assert isinstance(schema_symbol, Schema)
25
- graphql_app = GraphQL[Any, Any](schema_symbol, debug=log_operations)
21
+ graphql_app = GraphQL[Any, Any](schema_symbol)
26
22
 
27
23
  paths = ["/", "/graphql"]
28
24
  for path in paths:
@@ -127,7 +127,6 @@ class GraphQLRouter(
127
127
  allow_queries_via_get: bool = True,
128
128
  keep_alive: bool = False,
129
129
  keep_alive_interval: float = 1,
130
- debug: bool = False,
131
130
  root_value_getter: Optional[Callable[[], RootValue]] = None,
132
131
  context_getter: Optional[
133
132
  Callable[..., Union[Optional[Context], Awaitable[Optional[Context]]]]
@@ -183,7 +182,6 @@ class GraphQLRouter(
183
182
  self.allow_queries_via_get = allow_queries_via_get
184
183
  self.keep_alive = keep_alive
185
184
  self.keep_alive_interval = keep_alive_interval
186
- self.debug = debug
187
185
  self.root_value_getter = root_value_getter or self.__get_root_value
188
186
  # TODO: clean this type up
189
187
  self.context_getter = self.__get_context_getter(
@@ -88,7 +88,6 @@ class AsyncBaseHTTPView(
88
88
  ):
89
89
  schema: BaseSchema
90
90
  graphql_ide: Optional[GraphQL_IDE]
91
- debug: bool
92
91
  keep_alive = False
93
92
  keep_alive_interval: Optional[float] = None
94
93
  connection_init_wait_timeout: timedelta = timedelta(minutes=1)
@@ -325,7 +324,6 @@ class AsyncBaseHTTPView(
325
324
  context=context,
326
325
  root_value=root_value,
327
326
  schema=self.schema,
328
- debug=self.debug,
329
327
  connection_init_wait_timeout=self.connection_init_wait_timeout,
330
328
  ).handle()
331
329
  elif websocket_subprotocol == GRAPHQL_WS_PROTOCOL:
@@ -335,7 +333,6 @@ class AsyncBaseHTTPView(
335
333
  context=context,
336
334
  root_value=root_value,
337
335
  schema=self.schema,
338
- debug=self.debug,
339
336
  keep_alive=self.keep_alive,
340
337
  keep_alive_interval=self.keep_alive_interval,
341
338
  ).handle()
@@ -213,7 +213,6 @@ class GraphQLController(
213
213
  allow_queries_via_get: bool = True
214
214
  graphiql_allowed_accept: frozenset[str] = frozenset({"text/html", "*/*"})
215
215
  graphql_ide: Optional[GraphQL_IDE] = "graphiql"
216
- debug: bool = False
217
216
  connection_init_wait_timeout: timedelta = timedelta(minutes=1)
218
217
  protocols: Sequence[str] = (
219
218
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
@@ -370,7 +369,6 @@ def make_graphql_controller(
370
369
  allow_queries_via_get: bool = True,
371
370
  keep_alive: bool = False,
372
371
  keep_alive_interval: float = 1,
373
- debug: bool = False,
374
372
  # TODO: root typevar
375
373
  root_value_getter: Optional[AnyCallable] = None,
376
374
  # TODO: context typevar
@@ -420,7 +418,6 @@ def make_graphql_controller(
420
418
 
421
419
  _GraphQLController.keep_alive = keep_alive
422
420
  _GraphQLController.keep_alive_interval = keep_alive_interval
423
- _GraphQLController.debug = debug
424
421
  _GraphQLController.protocols = subscription_protocols
425
422
  _GraphQLController.connection_init_wait_timeout = connection_init_wait_timeout
426
423
  _GraphQLController.graphiql_allowed_accept = frozenset({"text/html", "*/*"})
strawberry/quart/views.py CHANGED
@@ -88,7 +88,6 @@ class GraphQLView(
88
88
  allow_queries_via_get: bool = True,
89
89
  keep_alive: bool = True,
90
90
  keep_alive_interval: float = 1,
91
- debug: bool = False,
92
91
  subscription_protocols: Sequence[str] = (
93
92
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
94
93
  GRAPHQL_WS_PROTOCOL,
@@ -100,7 +99,6 @@ class GraphQLView(
100
99
  self.allow_queries_via_get = allow_queries_via_get
101
100
  self.keep_alive = keep_alive
102
101
  self.keep_alive_interval = keep_alive_interval
103
- self.debug = debug
104
102
  self.subscription_protocols = subscription_protocols
105
103
  self.connection_init_wait_timeout = connection_init_wait_timeout
106
104
  self.multipart_uploads_enabled = multipart_uploads_enabled
strawberry/relay/utils.py CHANGED
@@ -7,7 +7,7 @@ from typing import TYPE_CHECKING, Any, Union
7
7
  from typing_extensions import Self, assert_never
8
8
 
9
9
  from strawberry.types.base import StrawberryObjectDefinition
10
- from strawberry.types.nodes import InlineFragment, Selection
10
+ from strawberry.types.nodes import InlineFragment
11
11
 
12
12
  if TYPE_CHECKING:
13
13
  from strawberry.types.info import Info
@@ -83,31 +83,19 @@ def should_resolve_list_connection_edges(info: Info) -> bool:
83
83
 
84
84
  """
85
85
  resolve_for_field_names = {"edges", "pageInfo"}
86
-
87
- def _check_selection(selection: Selection) -> bool:
88
- """Recursively inspect the selection to check if the user requested to resolve the `edges` field.
89
-
90
- Args:
91
- selection (Selection): The selection to check.
92
-
93
- Returns:
94
- bool: True if the user requested to resolve the `edges` field of a connection, False otherwise.
95
- """
86
+ # Recursively inspect the selection to check if the user requested to resolve the `edges` field.
87
+ stack = []
88
+ for selection_field in info.selected_fields:
89
+ stack.extend(selection_field.selections)
90
+ while stack:
91
+ selection = stack.pop()
96
92
  if (
97
93
  not isinstance(selection, InlineFragment)
98
94
  and selection.name in resolve_for_field_names
99
95
  ):
100
96
  return True
101
- if selection.selections:
102
- return any(
103
- _check_selection(selection) for selection in selection.selections
104
- )
105
- return False
106
-
107
- for selection_field in info.selected_fields:
108
- for selection in selection_field.selections:
109
- if _check_selection(selection):
110
- return True
97
+ if nested_selections := getattr(selection, "selections", None):
98
+ stack.extend(nested_selections)
111
99
  return False
112
100
 
113
101
 
@@ -34,7 +34,6 @@ from strawberry.types import ExecutionResult
34
34
  from strawberry.types.execution import PreExecutionError
35
35
  from strawberry.types.graphql import OperationType
36
36
  from strawberry.types.unset import UnsetType
37
- from strawberry.utils.debug import pretty_print_graphql_operation
38
37
  from strawberry.utils.operation import get_operation_type
39
38
 
40
39
  if TYPE_CHECKING:
@@ -55,7 +54,6 @@ class BaseGraphQLTransportWSHandler(Generic[Context, RootValue]):
55
54
  context: Context,
56
55
  root_value: Optional[RootValue],
57
56
  schema: BaseSchema,
58
- debug: bool,
59
57
  connection_init_wait_timeout: timedelta,
60
58
  ) -> None:
61
59
  self.view = view
@@ -63,7 +61,6 @@ class BaseGraphQLTransportWSHandler(Generic[Context, RootValue]):
63
61
  self.context = context
64
62
  self.root_value = root_value
65
63
  self.schema = schema
66
- self.debug = debug
67
64
  self.connection_init_wait_timeout = connection_init_wait_timeout
68
65
  self.connection_init_timeout_task: Optional[asyncio.Task] = None
69
66
  self.connection_init_received = False
@@ -237,13 +234,6 @@ class BaseGraphQLTransportWSHandler(Generic[Context, RootValue]):
237
234
  await self.websocket.close(code=4409, reason=reason)
238
235
  return
239
236
 
240
- if self.debug: # pragma: no cover
241
- pretty_print_graphql_operation(
242
- message["payload"].get("operationName"),
243
- message["payload"]["query"],
244
- message["payload"].get("variables"),
245
- )
246
-
247
237
  operation = Operation(
248
238
  self,
249
239
  message["id"],
@@ -27,7 +27,6 @@ from strawberry.subscriptions.protocols.graphql_ws.types import (
27
27
  )
28
28
  from strawberry.types.execution import ExecutionResult, PreExecutionError
29
29
  from strawberry.types.unset import UnsetType
30
- from strawberry.utils.debug import pretty_print_graphql_operation
31
30
 
32
31
  if TYPE_CHECKING:
33
32
  from collections.abc import AsyncGenerator
@@ -44,7 +43,6 @@ class BaseGraphQLWSHandler(Generic[Context, RootValue]):
44
43
  context: Context,
45
44
  root_value: Optional[RootValue],
46
45
  schema: BaseSchema,
47
- debug: bool,
48
46
  keep_alive: bool,
49
47
  keep_alive_interval: Optional[float],
50
48
  ) -> None:
@@ -53,7 +51,6 @@ class BaseGraphQLWSHandler(Generic[Context, RootValue]):
53
51
  self.context = context
54
52
  self.root_value = root_value
55
53
  self.schema = schema
56
- self.debug = debug
57
54
  self.keep_alive = keep_alive
58
55
  self.keep_alive_interval = keep_alive_interval
59
56
  self.keep_alive_task: Optional[asyncio.Task] = None
@@ -139,9 +136,6 @@ class BaseGraphQLWSHandler(Generic[Context, RootValue]):
139
136
  operation_name = payload.get("operationName")
140
137
  variables = payload.get("variables")
141
138
 
142
- if self.debug:
143
- pretty_print_graphql_operation(operation_name, query, variables)
144
-
145
139
  result_handler = self.handle_async_results(
146
140
  operation_id, query, operation_name, variables
147
141
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.280.0
3
+ Version: 0.281.0
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -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=8FKZTnvawxYpgEICOri-34O3wHRHLhRpjH_Ktp2EupQ,1801
6
- strawberry/aiohttp/views.py,sha256=95JdROO8LjCpAG1DvYyxDq96kYVfLzzuRJvDjiTqBZg,6656
6
+ strawberry/aiohttp/views.py,sha256=U6fdzvVmFv2wnnsrsgo6XfUTzG-uyYn0zDKJQvA4HF8,6600
7
7
  strawberry/annotation.py,sha256=68j7Sku1JT7pUTsUMxekWmQMyFdlV1D0jLFjukmmGpQ,15907
8
- strawberry/asgi/__init__.py,sha256=nX-YyE9I1t-np7sZ9CK02wBj8EYxZj1M4JAozQS9Rp4,7313
8
+ strawberry/asgi/__init__.py,sha256=hx1Qh13ER6k_PoS3VPStvPPcGUitMrB6MUXKN1Qhzgo,7257
9
9
  strawberry/asgi/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
10
10
  strawberry/asgi/test/client.py,sha256=kp2O5znHWuAB5VVYO8p4XPSTEDDXBSjNz5WHqW0r6GM,1473
11
11
  strawberry/chalice/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -14,7 +14,7 @@ strawberry/channels/__init__.py,sha256=AVmEwhzGHcTycMCnZYcZFFqZV8tKw9FJN4YXws-vW
14
14
  strawberry/channels/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  strawberry/channels/handlers/base.py,sha256=3mSvT2HMlOoWr0Y_8y1wwSmvCmB8osy2pEK1Kc5zJ5M,7841
16
16
  strawberry/channels/handlers/http_handler.py,sha256=EmRVgn0AHG9-dNUOU_rgKf0Ppsh8aiVYpXsVWMJKbNE,12461
17
- strawberry/channels/handlers/ws_handler.py,sha256=lf6nzr0HR9IQ5CEq-GoVCixUmMZO1uLlhdOoBVasyOA,6228
17
+ strawberry/channels/handlers/ws_handler.py,sha256=846Nj9bdcRJ1jezIa-Dmn3S_cgi8W-JTLt6mITG8ff4,6172
18
18
  strawberry/channels/router.py,sha256=DKIbl4zuRBhfvViUVpyu0Rf_WRT41E6uZC-Yic9Ltvo,2024
19
19
  strawberry/channels/testing.py,sha256=dc9mvSm9YdNOUgQk5ou5K4iE2h6TP5quKnk4Xdtn-IY,6558
20
20
  strawberry/cli/__init__.py,sha256=9rqBIeRSi0P0JljMWO43KC3inm4BBf0CX5pEWQWnTos,662
@@ -24,12 +24,12 @@ strawberry/cli/commands/codegen.py,sha256=WbX8uqF-dpQk1QjQm3H4AvNSZ4lIUOTSPghii3
24
24
  strawberry/cli/commands/export_schema.py,sha256=pyp_Q3BiO7lFH0L3mNPvr7UF8hlhcoUPqqBP4JPWUu0,1049
25
25
  strawberry/cli/commands/locate_definition.py,sha256=aJJ_KeAnV-c8zTdWIhzcHUilUmCpqsmrVy24qHbyWKk,1001
26
26
  strawberry/cli/commands/schema_codegen.py,sha256=G6eV08a51sjVxCm3jn75oPn9hC8YarKiAKOY5bpTuKU,749
27
- strawberry/cli/commands/server.py,sha256=qj5wn22HvyJDzwnWzduIWRnS912XvD7GRhPGJkbLaz4,2217
27
+ strawberry/cli/commands/server.py,sha256=Q55Eog7oseB127Qvy81MJPQb2DcVkACFg4NGJq2Hl24,1953
28
28
  strawberry/cli/commands/upgrade/__init__.py,sha256=yj7OxtXhvYdV-P072VFrLnbQmtREnYMLn7iku8gap6k,2596
29
29
  strawberry/cli/commands/upgrade/_fake_progress.py,sha256=fefLgJwTXe4kG9RntdEJdzkPPRBK_pZqnmMH-pxD85Y,484
30
30
  strawberry/cli/commands/upgrade/_run_codemod.py,sha256=LZd5D1PP65bwVZjBvPPVrZ9t-bfvrafZ__HPBrW2WYA,2168
31
- strawberry/cli/constants.py,sha256=GhhDZOl9lN4glq50OI1oSbPSGqQXEarZ6r_Grq8pcpI,138
32
- strawberry/cli/debug_server.py,sha256=mKxJZf_-SbWWusoFMzT8-E5qTshIx3IuciG6xlC21kI,999
31
+ strawberry/cli/constants.py,sha256=oELrG15571w3fG66EGBwtMHmMFbknJigkL385yzQnyI,67
32
+ strawberry/cli/debug_server.py,sha256=KANdDHyOybr2SZMs2OAuOf4Haz_SNSHKiiBeemx8fGc,868
33
33
  strawberry/cli/utils/__init__.py,sha256=5h6QMXbY4zbWVGg8xpsKlgWSEsNgn1fcjbRrJjgzdEc,987
34
34
  strawberry/cli/utils/load_schema.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  strawberry/codegen/__init__.py,sha256=qVfUJXv_2HqZTzi02An2V9auAseT9efi1f5APDG5DjA,250
@@ -115,7 +115,7 @@ strawberry/extensions/utils.py,sha256=sjhxItHzbDhqHtnR63WbE35qzHhTyf9NSffidet79H
115
115
  strawberry/extensions/validation_cache.py,sha256=Fp0bz0HfbMVjaOVfTyetR7Knhic0tthkzB_0kOOyJY0,1447
116
116
  strawberry/fastapi/__init__.py,sha256=p5qg9AlkYjNOWKcT4uRiebIpR6pIb1HqDMiDfF5O3tg,147
117
117
  strawberry/fastapi/context.py,sha256=O_cDNppfUJJecM0ZU_RJ-dhdF0o1x39JfYvYg-7uob4,684
118
- strawberry/fastapi/router.py,sha256=ssH9VnWfYNjYQ9Ldbxk1dPO3u59NBVe_XEEcX64AQDk,12089
118
+ strawberry/fastapi/router.py,sha256=i1V_Q7Lkff7tOG7Q4P2xzm5Of7YyWE2_PVUnfpbFytw,12033
119
119
  strawberry/federation/__init__.py,sha256=Pw01N0rG9o0NaUxXLMNGeW5oLENeWVx_d8Kuef1ES4s,549
120
120
  strawberry/federation/argument.py,sha256=rs71S1utiNUd4XOLRa9KVtSMA3yqvKJnR_qdJqX6PPM,860
121
121
  strawberry/federation/enum.py,sha256=geyNA00IjUBroBc6EFrTK0n6DGIVyKOeSE_3aqiwUaQ,3151
@@ -136,7 +136,7 @@ strawberry/file_uploads/utils.py,sha256=-c6TbqUI-Dkb96hWCrZabh6TL2OabBuQNkCarOqg
136
136
  strawberry/flask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
137
137
  strawberry/flask/views.py,sha256=eFB9s-gVNw8xEmHlxAkiMRlK2CCojQlDrPTf7aVsZvY,4579
138
138
  strawberry/http/__init__.py,sha256=8UWXKZ2IG6_nInp9liUj0qMquDNRR-9o--0EMBL-gnQ,1482
139
- strawberry/http/async_base_view.py,sha256=-n_gD2Wa8wAZcms89qDGX3jMrMNhwdEPZatS4bXIbiM,25688
139
+ strawberry/http/async_base_view.py,sha256=IGB5b_L6tTnCD_fNhLeCLu5q_KxdgWGfDQo-PiZDHPw,25596
140
140
  strawberry/http/base.py,sha256=TxvzTtHPrRTCQfJK5pbSXCE2AezT2gpKBRrN58a5Mmc,3215
141
141
  strawberry/http/exceptions.py,sha256=5uud0ZijcMC7TS9iiqMTre9DVIe04judh8E8nSbwxy8,258
142
142
  strawberry/http/ides.py,sha256=WjU0nsMDgr3Bd1ebWkUEkO2d1hk0dI16mLqXyCHqklA,613
@@ -146,7 +146,7 @@ strawberry/http/temporal_response.py,sha256=HTt65g-YxqlPGxjqvH5bzGoU1b3CctVR-9cm
146
146
  strawberry/http/types.py,sha256=H0wGOdCO-5tNKZM_6cAtNRwZAjoEXnAC5N0Q7b70AtU,398
147
147
  strawberry/http/typevars.py,sha256=Uu6NkKe3h7o29ZWwldq6sJy4ioSSeXODTCDRvY2hUpE,489
148
148
  strawberry/litestar/__init__.py,sha256=zsXzg-mglCGUVO9iNXLm-yadoDSCK7k-zuyRqyvAh1w,237
149
- strawberry/litestar/controller.py,sha256=s5vQUy9Xs43gwZU5DAu6jklHocgcEOnbiBj_aPakZsM,13108
149
+ strawberry/litestar/controller.py,sha256=uYHkfcys2NGvCRGnWK9rOs5rgpETS6h6Y2ACost5Yxg,13022
150
150
  strawberry/parent.py,sha256=JYFp-HGCgwbH2oB4uLSiIO4cVsoPaxX6lfYmxOKPkSg,1362
151
151
  strawberry/permission.py,sha256=dSRJMjSCmTlXfvfC24kCSrAk0txTjYKTJ5ZVU5IW91Y,7537
152
152
  strawberry/printer/__init__.py,sha256=DmepjmgtkdF5RxK_7yC6qUyRWn56U-9qeZMbkztYB9w,62
@@ -154,12 +154,12 @@ strawberry/printer/ast_from_value.py,sha256=Tkme60qlykbN2m3dNPNMOe65X-wj6EmcDQwg
154
154
  strawberry/printer/printer.py,sha256=5E9w0wDsUv1hvkeXof12277NLMiCVy5MgJ6gSo_NJhQ,19177
155
155
  strawberry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
156
156
  strawberry/quart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
- strawberry/quart/views.py,sha256=otrWlDdbgHooxAjD7Sf-E82B-PmOaNwCN07oF7Bjhsg,6618
157
+ strawberry/quart/views.py,sha256=hgUAyGh8R3Js3mLIWevhvRWewbyiUAwbUIp5A_R7v_c,6562
158
158
  strawberry/relay/__init__.py,sha256=Vi4btvA_g6Cj9Tk_F9GCSegapIf2WqkOWV8y3P0cTCs,553
159
159
  strawberry/relay/exceptions.py,sha256=Za0iXLBGZtd1HkesGm4xTr3QOeuyiCAe1hiCCQ2HHvE,4036
160
160
  strawberry/relay/fields.py,sha256=eqQOH8JAWZUP52nwaYCZ_z5Jvp69_T_gx1pxjrdgV1k,18284
161
161
  strawberry/relay/types.py,sha256=rndxONPRkBZUE6u6aTDynL9Lm7Ahkr7jOPT6IIQSrVE,30460
162
- strawberry/relay/utils.py,sha256=-QxroxkSYtFnMYsJyTyfIi0I1fLtjnt6siW0kLNiyfs,5908
162
+ strawberry/relay/utils.py,sha256=0qllwh7MGALK8UUdvjwjlYaaFGvlFUzkcUKdyhx3L9Y,5552
163
163
  strawberry/resolvers.py,sha256=Vdidc3YFc4-olSQZD_xQ1icyAFbyzqs_8I3eSpMFlA4,260
164
164
  strawberry/sanic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
165
  strawberry/sanic/context.py,sha256=qN7I9K_qIqgdbG_FbDl8XMb9aM1PyjIxSo8IAg2Uq8o,844
@@ -192,10 +192,10 @@ strawberry/streamable.py,sha256=8dqvKAv_Nhp8vEi4PUYyziCt3SUyCr6ZuqCNZ46Mqno,611
192
192
  strawberry/subscriptions/__init__.py,sha256=1VGmiCzFepqRFyCikagkUoHHdoTG3XYlFu9GafoQMws,170
193
193
  strawberry/subscriptions/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
194
194
  strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py,sha256=wN6dkMu6WiaIZTE19PGoN9xXpIN_RdDE_q7F7ZgjCxk,138
195
- strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py,sha256=Uy7UWPAgbCEIZfMs1R6RDIStLkHCM33Zsc0sMpgDwrc,15485
195
+ strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py,sha256=-URgId_r8Q0nTiGT1AqtvVUdWyhqPlCE7qR5f7T_M-U,15114
196
196
  strawberry/subscriptions/protocols/graphql_transport_ws/types.py,sha256=N9r2mXg5jmmjYoZV5rWf3lAzgylCOUrbKGmClXCoOso,2169
197
197
  strawberry/subscriptions/protocols/graphql_ws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
198
- strawberry/subscriptions/protocols/graphql_ws/handlers.py,sha256=6Rz47q-VbzTVyL48hgHYoGpT1MRMytFi2SDGreD7axw,8668
198
+ strawberry/subscriptions/protocols/graphql_ws/handlers.py,sha256=krxrmWYE68Y-Qx6XnNfdz5Sdq0ShZI1oeTj_kFEKP50,8453
199
199
  strawberry/subscriptions/protocols/graphql_ws/types.py,sha256=Uumiz-1O5qQnx-ERBaQtaf7db5yx-V9LMypOn9oGKwM,2003
200
200
  strawberry/test/__init__.py,sha256=lKVbKJDBnrYSPYHIKrg54UpaZcSoL93Z01zOpA1IzZM,115
201
201
  strawberry/test/client.py,sha256=ILAttb6A3jplH5wJNMeyyT1u_Q8KnollfpYLP_BVZR4,6438
@@ -228,7 +228,6 @@ strawberry/utils/__init__.py,sha256=wuuNvKjcMfE0l4lqrlC-cc0_SR4hV19gNBJ3Mcn7l3A,
228
228
  strawberry/utils/aio.py,sha256=Nry5jxFHvipGS1CwX5VvFS2YQ6_bp-_cewnI6v9A7-A,2226
229
229
  strawberry/utils/await_maybe.py,sha256=YdjfuzjDVjph0VH0WkwvU4ezsjl_fELnGrLC1_bvb_U,449
230
230
  strawberry/utils/dataclasses.py,sha256=1wvVq0vgvjrRSamJ3CBJpkLu1KVweTmw5JLXmagdGes,856
231
- strawberry/utils/debug.py,sha256=eP-wyKSSt7YHHY_lJdSa2hDlrBPd72kDtmGdFZ0Kyyo,1440
232
231
  strawberry/utils/deprecations.py,sha256=Yrp4xBzp36mQprH8qPHpPMhkCLm527q7XU7pP4aar_0,782
233
232
  strawberry/utils/graphql_lexer.py,sha256=JUVJrJ6Ax0t7m6-DTWFzf4cvXrC02VPmL1NS2zMEMbY,1255
234
233
  strawberry/utils/importer.py,sha256=NtTgNaNSW4TnlLo_S34nxXq14RxUAec-QlEZ0LON28M,629
@@ -238,8 +237,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
238
237
  strawberry/utils/operation.py,sha256=ZgVOw3K2jQuLjNOYUHauF7itJD0QDNoPw9PBi0IYf6k,1234
239
238
  strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
240
239
  strawberry/utils/typing.py,sha256=SDvX-Du-9HAV3-XXjqi7Q5f5qPDDFd_gASIITiwBQT4,14073
241
- strawberry_graphql-0.280.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
242
- strawberry_graphql-0.280.0.dist-info/METADATA,sha256=9qNSWDt50fP_5T8ielfg-EmwUme30KmzwbipRfl107c,7426
243
- strawberry_graphql-0.280.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
244
- strawberry_graphql-0.280.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
245
- strawberry_graphql-0.280.0.dist-info/RECORD,,
240
+ strawberry_graphql-0.281.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
241
+ strawberry_graphql-0.281.0.dist-info/METADATA,sha256=r4ayfeMVhBiwfeMWmemebD2HXL5-6-0Qu_deYeTwqUY,7426
242
+ strawberry_graphql-0.281.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
243
+ strawberry_graphql-0.281.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
244
+ strawberry_graphql-0.281.0.dist-info/RECORD,,
strawberry/utils/debug.py DELETED
@@ -1,46 +0,0 @@
1
- import datetime
2
- import json
3
- from json import JSONEncoder
4
- from typing import Any, Optional
5
-
6
-
7
- class StrawberryJSONEncoder(JSONEncoder):
8
- def default(self, o: Any) -> Any:
9
- return repr(o)
10
-
11
-
12
- def pretty_print_graphql_operation(
13
- operation_name: Optional[str], query: str, variables: Optional[dict["str", Any]]
14
- ) -> None:
15
- """Pretty print a GraphQL operation using pygments.
16
-
17
- Won't print introspection operation to prevent noise in the output.
18
- """
19
- try:
20
- from pygments import highlight, lexers
21
- from pygments.formatters import Terminal256Formatter
22
- except ImportError as e:
23
- raise ImportError(
24
- "pygments is not installed but is required for debug output, install it "
25
- "directly or run `pip install strawberry-graphql[debug-server]`"
26
- ) from e
27
-
28
- from .graphql_lexer import GraphQLLexer
29
-
30
- if operation_name == "IntrospectionQuery":
31
- return
32
-
33
- now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") # noqa: DTZ005
34
-
35
- print(f"[{now}]: {operation_name or 'No operation name'}") # noqa: T201
36
- print(highlight(query, GraphQLLexer(), Terminal256Formatter())) # noqa: T201
37
-
38
- if variables:
39
- variables_json = json.dumps(variables, indent=4, cls=StrawberryJSONEncoder)
40
-
41
- print( # noqa: T201
42
- highlight(variables_json, lexers.JsonLexer(), Terminal256Formatter())
43
- )
44
-
45
-
46
- __all__ = ["pretty_print_graphql_operation"]