strawberry-graphql 0.263.0.dev1743582446__py3-none-any.whl → 0.263.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/__init__.py CHANGED
@@ -11,7 +11,6 @@ from .permission import BasePermission
11
11
  from .scalars import ID
12
12
  from .schema import Schema
13
13
  from .schema_directive import schema_directive
14
- from .streamable import Streamable
15
14
  from .types.arguments import argument
16
15
  from .types.auto import auto
17
16
  from .types.cast import cast
@@ -35,7 +34,6 @@ __all__ = [
35
34
  "Parent",
36
35
  "Private",
37
36
  "Schema",
38
- "Streamable",
39
37
  "argument",
40
38
  "asdict",
41
39
  "auto",
strawberry/annotation.py CHANGED
@@ -17,7 +17,6 @@ from typing import (
17
17
  )
18
18
  from typing_extensions import Self, get_args, get_origin
19
19
 
20
- from strawberry.streamable import StrawberryStreamable
21
20
  from strawberry.types.base import (
22
21
  StrawberryList,
23
22
  StrawberryObjectDefinition,
@@ -142,8 +141,6 @@ class StrawberryAnnotation:
142
141
 
143
142
  if self._is_lazy_type(evaled_type):
144
143
  return evaled_type
145
- if self._is_streamable(evaled_type, args):
146
- return self.create_list(list[evaled_type])
147
144
  if self._is_list(evaled_type):
148
145
  return self.create_list(evaled_type)
149
146
 
@@ -313,10 +310,6 @@ class StrawberryAnnotation:
313
310
  or is_list
314
311
  )
315
312
 
316
- @classmethod
317
- def _is_streamable(cls, annotation: Any, args: list[Any]) -> bool:
318
- return any(isinstance(arg, StrawberryStreamable) for arg in args)
319
-
320
313
  @classmethod
321
314
  def _is_strawberry_type(cls, evaled_type: Any) -> bool:
322
315
  # Prevent import cycles
@@ -293,7 +293,8 @@ class GraphQLHTTPConsumer(
293
293
 
294
294
  async def render_graphql_ide(self, request: ChannelsRequest) -> ChannelsResponse:
295
295
  return ChannelsResponse(
296
- content=self.graphql_ide_html.encode(), content_type="text/html"
296
+ content=self.graphql_ide_html.encode(),
297
+ content_type="text/html; charset=utf-8",
297
298
  )
298
299
 
299
300
  def is_websocket_request(
@@ -348,7 +349,8 @@ class SyncGraphQLHTTPConsumer(
348
349
 
349
350
  def render_graphql_ide(self, request: ChannelsRequest) -> ChannelsResponse:
350
351
  return ChannelsResponse(
351
- content=self.graphql_ide_html.encode(), content_type="text/html"
352
+ content=self.graphql_ide_html.encode(),
353
+ content_type="text/html; charset=utf-8",
352
354
  )
353
355
 
354
356
  # Sync channels is actually async, but it uses database_sync_to_async to call
@@ -12,7 +12,7 @@ from pydantic.version import VERSION as PYDANTIC_VERSION
12
12
  from strawberry.experimental.pydantic.exceptions import UnsupportedTypeError
13
13
 
14
14
  if TYPE_CHECKING:
15
- from pydantic.fields import FieldInfo
15
+ from pydantic.fields import ComputedFieldInfo, FieldInfo
16
16
 
17
17
  IS_PYDANTIC_V2: bool = PYDANTIC_VERSION.startswith("2.")
18
18
  IS_PYDANTIC_V1: bool = not IS_PYDANTIC_V2
@@ -128,7 +128,33 @@ class PydanticV2Compat:
128
128
 
129
129
  return PydanticUndefined
130
130
 
131
- def get_model_fields(self, model: type[BaseModel]) -> dict[str, CompatModelField]:
131
+ def get_model_computed_fields(
132
+ self, model: type[BaseModel]
133
+ ) -> dict[str, CompatModelField]:
134
+ computed_field_info: dict[str, ComputedFieldInfo] = model.model_computed_fields
135
+ new_fields = {}
136
+ # Convert it into CompatModelField
137
+ for name, field in computed_field_info.items():
138
+ new_fields[name] = CompatModelField(
139
+ name=name,
140
+ type_=field.return_type,
141
+ outer_type_=field.return_type,
142
+ default=None,
143
+ default_factory=None,
144
+ required=False,
145
+ alias=field.alias,
146
+ # v2 doesn't have allow_none
147
+ allow_none=False,
148
+ has_alias=field is not None,
149
+ description=field.description,
150
+ _missing_type=self.PYDANTIC_MISSING_TYPE,
151
+ is_v1=False,
152
+ )
153
+ return new_fields
154
+
155
+ def get_model_fields(
156
+ self, model: type[BaseModel], include_computed: bool = False
157
+ ) -> dict[str, CompatModelField]:
132
158
  field_info: dict[str, FieldInfo] = model.model_fields
133
159
  new_fields = {}
134
160
  # Convert it into CompatModelField
@@ -148,6 +174,8 @@ class PydanticV2Compat:
148
174
  _missing_type=self.PYDANTIC_MISSING_TYPE,
149
175
  is_v1=False,
150
176
  )
177
+ if include_computed:
178
+ new_fields |= self.get_model_computed_fields(model)
151
179
  return new_fields
152
180
 
153
181
  @cached_property
@@ -175,7 +203,10 @@ class PydanticV1Compat:
175
203
  def PYDANTIC_MISSING_TYPE(self) -> Any: # noqa: N802
176
204
  return dataclasses.MISSING
177
205
 
178
- def get_model_fields(self, model: type[BaseModel]) -> dict[str, CompatModelField]:
206
+ def get_model_fields(
207
+ self, model: type[BaseModel], include_computed: bool = False
208
+ ) -> dict[str, CompatModelField]:
209
+ """`include_computed` is a noop for PydanticV1Compat."""
179
210
  new_fields = {}
180
211
  # Convert it into CompatModelField
181
212
  for name, field in model.__fields__.items(): # type: ignore[attr-defined]
@@ -284,7 +315,6 @@ else:
284
315
  smart_deepcopy,
285
316
  )
286
317
 
287
-
288
318
  __all__ = [
289
319
  "PydanticCompat",
290
320
  "get_args",
@@ -126,11 +126,12 @@ def type( # noqa: PLR0915
126
126
  description: Optional[str] = None,
127
127
  directives: Optional[Sequence[object]] = (),
128
128
  all_fields: bool = False,
129
+ include_computed: bool = False,
129
130
  use_pydantic_alias: bool = True,
130
131
  ) -> Callable[..., builtins.type[StrawberryTypeFromPydantic[PydanticModel]]]:
131
132
  def wrap(cls: Any) -> builtins.type[StrawberryTypeFromPydantic[PydanticModel]]: # noqa: PLR0915
132
133
  compat = PydanticCompat.from_model(model)
133
- model_fields = compat.get_model_fields(model)
134
+ model_fields = compat.get_model_fields(model, include_computed=include_computed)
134
135
  original_fields_set = set(fields) if fields else set()
135
136
 
136
137
  if fields:
@@ -171,7 +172,10 @@ def type( # noqa: PLR0915
171
172
  raise MissingFieldsListError(cls)
172
173
 
173
174
  ensure_all_auto_fields_in_pydantic(
174
- model=model, auto_fields=auto_fields_set, cls_name=cls.__name__
175
+ model=model,
176
+ auto_fields=auto_fields_set,
177
+ cls_name=cls.__name__,
178
+ include_computed=include_computed,
175
179
  )
176
180
 
177
181
  wrapped = _wrap_dataclass(cls)
@@ -117,11 +117,17 @@ def get_default_factory_for_field(
117
117
 
118
118
 
119
119
  def ensure_all_auto_fields_in_pydantic(
120
- model: type[BaseModel], auto_fields: set[str], cls_name: str
120
+ model: type[BaseModel],
121
+ auto_fields: set[str],
122
+ cls_name: str,
123
+ include_computed: bool = False,
121
124
  ) -> None:
122
125
  compat = PydanticCompat.from_model(model)
123
126
  # Raise error if user defined a strawberry.auto field not present in the model
124
- non_existing_fields = list(auto_fields - compat.get_model_fields(model).keys())
127
+ non_existing_fields = list(
128
+ auto_fields
129
+ - compat.get_model_fields(model, include_computed=include_computed).keys()
130
+ )
125
131
 
126
132
  if non_existing_fields:
127
133
  raise AutoFieldsNotInBaseModelError(
@@ -42,9 +42,10 @@ class OpenTelemetryExtension(SchemaExtension):
42
42
  *,
43
43
  execution_context: Optional[ExecutionContext] = None,
44
44
  arg_filter: Optional[ArgFilter] = None,
45
+ tracer_provider: Optional[trace.TracerProvider] = None,
45
46
  ) -> None:
46
47
  self._arg_filter = arg_filter
47
- self._tracer = trace.get_tracer("strawberry")
48
+ self._tracer = trace.get_tracer("strawberry", tracer_provider=tracer_provider)
48
49
  self._span_holder = {}
49
50
  if execution_context:
50
51
  self.execution_context = execution_context
@@ -1,13 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from dataclasses import dataclass
4
- from typing import Any, Optional
4
+ from typing import TYPE_CHECKING, Any, Optional
5
5
  from typing_extensions import Literal, TypedDict
6
6
 
7
- from strawberry.schema._graphql_core import (
8
- GraphQLIncrementalExecutionResults,
9
- ResultType,
10
- )
7
+ if TYPE_CHECKING:
8
+ from strawberry.types import ExecutionResult
11
9
 
12
10
 
13
11
  class GraphQLHTTPResponse(TypedDict, total=False):
@@ -16,10 +14,7 @@ class GraphQLHTTPResponse(TypedDict, total=False):
16
14
  extensions: Optional[dict[str, object]]
17
15
 
18
16
 
19
- def process_result(result: ResultType) -> GraphQLHTTPResponse:
20
- if isinstance(result, GraphQLIncrementalExecutionResults):
21
- return result
22
-
17
+ def process_result(result: ExecutionResult) -> GraphQLHTTPResponse:
23
18
  data: GraphQLHTTPResponse = {"data": result.data}
24
19
 
25
20
  if result.errors:
@@ -25,9 +25,6 @@ from strawberry.http import (
25
25
  process_result,
26
26
  )
27
27
  from strawberry.http.ides import GraphQL_IDE
28
- from strawberry.schema._graphql_core import (
29
- GraphQLIncrementalExecutionResults,
30
- )
31
28
  from strawberry.schema.base import BaseSchema
32
29
  from strawberry.schema.exceptions import InvalidOperationTypeError
33
30
  from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
@@ -261,7 +258,7 @@ class AsyncBaseHTTPView(
261
258
  root_value: Optional[RootValue] = UNSET,
262
259
  ) -> WebSocketResponse: ...
263
260
 
264
- async def run( # noqa: PLR0915
261
+ async def run(
265
262
  self,
266
263
  request: Union[Request, WebSocketRequest],
267
264
  context: Optional[Context] = UNSET,
@@ -352,75 +349,6 @@ class AsyncBaseHTTPView(
352
349
  "Content-Type": "multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json",
353
350
  },
354
351
  )
355
- if isinstance(result, GraphQLIncrementalExecutionResults):
356
-
357
- async def stream() -> AsyncGenerator[str, None]:
358
- yield "---"
359
-
360
- response = await self.process_result(request, result.initial_result)
361
-
362
- response["hasNext"] = result.initial_result.has_next
363
- response["pending"] = [
364
- p.formatted for p in result.initial_result.pending
365
- ]
366
- response["extensions"] = result.initial_result.extensions
367
-
368
- yield self.encode_multipart_data(response, "-")
369
-
370
- all_pending = result.initial_result.pending
371
-
372
- async for value in result.subsequent_results:
373
- response = {
374
- "hasNext": value.has_next,
375
- "extensions": value.extensions,
376
- }
377
-
378
- if value.pending:
379
- response["pending"] = [p.formatted for p in value.pending]
380
-
381
- if value.completed:
382
- response["completed"] = [p.formatted for p in value.completed]
383
-
384
- if value.incremental:
385
- incremental = []
386
-
387
- all_pending.extend(value.pending)
388
-
389
- for incremental_value in value.incremental:
390
- pending_value = next(
391
- (
392
- v
393
- for v in all_pending
394
- if v.id == incremental_value.id
395
- ),
396
- None,
397
- )
398
-
399
- assert pending_value
400
-
401
- incremental.append(
402
- {
403
- **incremental_value.formatted,
404
- "path": pending_value.path,
405
- "label": pending_value.label,
406
- }
407
- )
408
-
409
- response["incremental"] = incremental
410
-
411
- yield self.encode_multipart_data(response, "-")
412
-
413
- yield "--\r\n"
414
-
415
- return await self.create_streaming_response(
416
- request,
417
- stream,
418
- sub_response,
419
- headers={
420
- "Transfer-Encoding": "chunked",
421
- "Content-Type": 'multipart/mixed; boundary="-"',
422
- },
423
- )
424
352
 
425
353
  response_data = await self.process_result(request=request, result=result)
426
354
 
@@ -432,16 +360,12 @@ class AsyncBaseHTTPView(
432
360
  )
433
361
 
434
362
  def encode_multipart_data(self, data: Any, separator: str) -> str:
435
- encoded_data = self.encode_json(data)
436
-
437
363
  return "".join(
438
364
  [
439
- "\r\n",
440
- "Content-Type: application/json; charset=utf-8\r\n",
441
- "Content-Length: " + str(len(encoded_data)) + "\r\n",
442
- "\r\n",
443
- encoded_data,
444
- f"\r\n--{separator}",
365
+ f"\r\n--{separator}\r\n",
366
+ "Content-Type: application/json\r\n\r\n",
367
+ self.encode_json(data),
368
+ "\n",
445
369
  ]
446
370
  )
447
371
 
@@ -561,9 +561,9 @@ def print_schema_definition(
561
561
  def print_directive(
562
562
  directive: GraphQLDirective, *, schema: BaseSchema
563
563
  ) -> Optional[str]:
564
- strawberry_directive = directive.extensions.get("strawberry-definition")
564
+ strawberry_directive = directive.extensions["strawberry-definition"]
565
565
 
566
- if strawberry_directive is None or (
566
+ if (
567
567
  isinstance(strawberry_directive, StrawberrySchemaDirective)
568
568
  and not strawberry_directive.print_definition
569
569
  ):
@@ -16,7 +16,6 @@ class StrawberryConfig:
16
16
  relay_max_results: int = 100
17
17
  disable_field_suggestions: bool = False
18
18
  info_class: type[Info] = Info
19
- enable_experimental_incremental_execution: bool = False
20
19
 
21
20
  def __post_init__(
22
21
  self,
@@ -29,6 +29,8 @@ from graphql import (
29
29
  parse,
30
30
  validate_schema,
31
31
  )
32
+ from graphql.execution import ExecutionContext as GraphQLExecutionContext
33
+ from graphql.execution import execute, subscribe
32
34
  from graphql.execution.middleware import MiddlewareManager
33
35
  from graphql.type.directives import specified_directives
34
36
  from graphql.validation import validate
@@ -61,15 +63,6 @@ from strawberry.utils import IS_GQL_32
61
63
  from strawberry.utils.await_maybe import await_maybe
62
64
 
63
65
  from . import compat
64
- from ._graphql_core import (
65
- GraphQLExecutionContext,
66
- GraphQLIncrementalExecutionResults,
67
- ResultType,
68
- execute,
69
- experimental_execute_incrementally,
70
- incremental_execution_directives,
71
- subscribe,
72
- )
73
66
  from .base import BaseSchema
74
67
  from .config import StrawberryConfig
75
68
  from .exceptions import InvalidOperationTypeError
@@ -98,7 +91,6 @@ OriginSubscriptionResult = Union[
98
91
  AsyncIterator[OriginalExecutionResult],
99
92
  ]
100
93
 
101
-
102
94
  DEFAULT_ALLOWED_OPERATION_TYPES = {
103
95
  OperationType.QUERY,
104
96
  OperationType.MUTATION,
@@ -267,16 +259,11 @@ class Schema(BaseSchema):
267
259
  graphql_types.append(graphql_type)
268
260
 
269
261
  try:
270
- directives = specified_directives + tuple(graphql_directives)
271
-
272
- if self.config.enable_experimental_incremental_execution:
273
- directives = tuple(directives) + tuple(incremental_execution_directives)
274
-
275
262
  self._schema = GraphQLSchema(
276
263
  query=query_type,
277
264
  mutation=mutation_type,
278
265
  subscription=subscription_type if subscription else None,
279
- directives=directives,
266
+ directives=specified_directives + tuple(graphql_directives),
280
267
  types=graphql_types,
281
268
  extensions={
282
269
  GraphQLCoreConverter.DEFINITION_BACKREF: self,
@@ -454,16 +441,12 @@ class Schema(BaseSchema):
454
441
  async def _handle_execution_result(
455
442
  self,
456
443
  context: ExecutionContext,
457
- result: ResultType,
444
+ result: Union[GraphQLExecutionResult, ExecutionResult],
458
445
  extensions_runner: SchemaExtensionsRunner,
459
446
  *,
460
447
  # TODO: can we remove this somehow, see comment in execute
461
448
  skip_process_errors: bool = False,
462
449
  ) -> ExecutionResult:
463
- # TODO: handle this, also, why do we have both GraphQLExecutionResult and ExecutionResult?
464
- if isinstance(result, GraphQLIncrementalExecutionResults):
465
- return result
466
-
467
450
  # Set errors on the context so that it's easier
468
451
  # to access in extensions
469
452
  if result.errors:
@@ -504,14 +487,6 @@ class Schema(BaseSchema):
504
487
  extensions_runner = self.create_extensions_runner(execution_context, extensions)
505
488
  middleware_manager = self._get_middleware_manager(extensions)
506
489
 
507
- execute_function = (
508
- experimental_execute_incrementally
509
- if self.config.enable_experimental_incremental_execution
510
- else execute
511
- )
512
-
513
- # TODO: raise if experimental_execute_incrementally is not available
514
-
515
490
  try:
516
491
  async with extensions_runner.operation():
517
492
  # Note: In graphql-core the schema would be validated here but in
@@ -530,7 +505,7 @@ class Schema(BaseSchema):
530
505
  async with extensions_runner.executing():
531
506
  if not execution_context.result:
532
507
  result = await await_maybe(
533
- execute_function(
508
+ execute(
534
509
  self._schema,
535
510
  execution_context.graphql_document,
536
511
  root_value=execution_context.root_value,
@@ -546,9 +521,7 @@ class Schema(BaseSchema):
546
521
  result = execution_context.result
547
522
  # Also set errors on the execution_context so that it's easier
548
523
  # to access in extensions
549
-
550
- # TODO: maybe here use the first result from incremental execution if it exists
551
- if isinstance(result, GraphQLExecutionResult) and result.errors:
524
+ if result.errors:
552
525
  execution_context.errors = result.errors
553
526
 
554
527
  # Run the `Schema.process_errors` function here before
@@ -598,14 +571,6 @@ class Schema(BaseSchema):
598
571
  extensions_runner = self.create_extensions_runner(execution_context, extensions)
599
572
  middleware_manager = self._get_middleware_manager(extensions)
600
573
 
601
- execute_function = (
602
- experimental_execute_incrementally
603
- if self.config.enable_experimental_incremental_execution
604
- else execute
605
- )
606
-
607
- # TODO: raise if experimental_execute_incrementally is not available
608
-
609
574
  try:
610
575
  with extensions_runner.operation():
611
576
  # Note: In graphql-core the schema would be validated here but in
@@ -647,7 +612,7 @@ class Schema(BaseSchema):
647
612
 
648
613
  with extensions_runner.executing():
649
614
  if not execution_context.result:
650
- result = execute_function(
615
+ result = execute(
651
616
  self._schema,
652
617
  execution_context.graphql_document,
653
618
  root_value=execution_context.root_value,
@@ -1,4 +1,4 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
4
  <title>Strawberry GraphiQL</title>
@@ -61,8 +61,8 @@
61
61
  <link
62
62
  crossorigin
63
63
  rel="stylesheet"
64
- href="https://unpkg.com/graphiql@3.8.3/graphiql.min.css"
65
- integrity="sha384-Mq3vbRBY71jfjQAt/DcjxUIYY33ksal4cgdRt9U/hNPvHBCaT2JfJ/PTRiPKf0aM"
64
+ href="https://unpkg.com/graphiql@3.0.9/graphiql.min.css"
65
+ integrity="sha384-yz3/sqpuplkA7msMo0FE4ekg0xdwdvZ8JX9MVZREsxipqjU4h8IRfmAMRcb1QpUy"
66
66
  />
67
67
 
68
68
  <link
@@ -77,8 +77,8 @@
77
77
  <div id="graphiql" class="graphiql-container">Loading...</div>
78
78
  <script
79
79
  crossorigin
80
- src="https://unpkg.com/graphiql@3.8.3/graphiql.min.js"
81
- integrity="sha384-HbRVEFG0JGJZeAHCJ9Xm2+tpknBQ7QZmNlO/DgZtkZ0aJSypT96YYGRNod99l9Ie"
80
+ src="https://unpkg.com/graphiql@3.0.9/graphiql.min.js"
81
+ integrity="sha384-Mjte+vxCWz1ZYCzszGHiJqJa5eAxiqI4mc3BErq7eDXnt+UGLXSEW7+i0wmfPiji"
82
82
  ></script>
83
83
  <script
84
84
  crossorigin
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.263.0.dev1743582446
3
+ Version: 0.263.1
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -1,10 +1,10 @@
1
- strawberry/__init__.py,sha256=HqViVAW5hyZLiG0CvWgLvdBotbbDAimuGgKSzevP-O8,1482
1
+ strawberry/__init__.py,sha256=VcqNwegcJS_YhCOrZyveD_wBcd-hh8KKrXcIlTc7knE,1429
2
2
  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
6
  strawberry/aiohttp/views.py,sha256=JXYd_qO_LD4QbRJ7iAnZbEsezwvPOmTujTGNAb75bRU,7885
7
- strawberry/annotation.py,sha256=V7OrkVk8anXg1teACmxr3tWA7Q9daT-1Xeo-kN0P1fc,13362
7
+ strawberry/annotation.py,sha256=FYoUNz857yt3Hewm8bYFmMLpG7dTdKpc4j9nBGsv40k,13038
8
8
  strawberry/asgi/__init__.py,sha256=55tsJmqIPlQgeScDUQuADalLlN5ymdHOeFHWzyII7aY,8167
9
9
  strawberry/asgi/test/__init__.py,sha256=4xxdUZtIISSOwjrcnmox7AvT4WWjowCm5bUuPdQneMg,71
10
10
  strawberry/asgi/test/client.py,sha256=kp2O5znHWuAB5VVYO8p4XPSTEDDXBSjNz5WHqW0r6GM,1473
@@ -13,7 +13,7 @@ strawberry/chalice/views.py,sha256=-bYqNxeiWpxpstdlh0ZQxpNUB9ZaBEVvEwn3Z5yTT8k,4
13
13
  strawberry/channels/__init__.py,sha256=AVmEwhzGHcTycMCnZYcZFFqZV8tKw9FJN4YXws-vWFA,433
14
14
  strawberry/channels/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  strawberry/channels/handlers/base.py,sha256=3mSvT2HMlOoWr0Y_8y1wwSmvCmB8osy2pEK1Kc5zJ5M,7841
16
- strawberry/channels/handlers/http_handler.py,sha256=Gj1_rJMZRlHWXrmx6rqtQcpZxbZkeWBlSzlaurBZepc,11591
16
+ strawberry/channels/handlers/http_handler.py,sha256=zDwMVIjAiMVwsXOwq4Iy8IqwUAO8FNba3OPk76uWIGM,11647
17
17
  strawberry/channels/handlers/ws_handler.py,sha256=yw9HqwReLGGLcLcK_e4gDaQMua31_Ds7JGwuSD9REZQ,6169
18
18
  strawberry/channels/router.py,sha256=DKIbl4zuRBhfvViUVpyu0Rf_WRT41E6uZC-Yic9Ltvo,2024
19
19
  strawberry/channels/testing.py,sha256=dc9mvSm9YdNOUgQk5ou5K4iE2h6TP5quKnk4Xdtn-IY,6558
@@ -73,14 +73,14 @@ strawberry/exceptions/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
73
73
  strawberry/exceptions/utils/source_finder.py,sha256=kqSjCGIlnkD0DuCBYElqConp9wAvAyQ8kIHKgnmupjY,20123
74
74
  strawberry/experimental/__init__.py,sha256=2HP5XtxL8ZKsPp4EDRAbMCqiP7p2V4Cca278JUGxnt0,102
75
75
  strawberry/experimental/pydantic/__init__.py,sha256=UpO8wHNXGpoCYp34YStViInO1tsrGsMyhTVubTpJY7Y,255
76
- strawberry/experimental/pydantic/_compat.py,sha256=GN_EQK_Pa3tlzTH3iVEvjerauFOJDNnpDHk7jrD5Dt0,8523
76
+ strawberry/experimental/pydantic/_compat.py,sha256=CUc7SmGA-viYoBgD4L8X483yTGyDKaKMjX3WYWkiohg,9710
77
77
  strawberry/experimental/pydantic/conversion.py,sha256=210v83ttSVhBlNM52to-x8s80V9WuOPez94qd5yDOD4,4224
78
78
  strawberry/experimental/pydantic/conversion_types.py,sha256=jf7PR5Q7hgo4J_AuxBK-BVj-8MC6vIg1k1pUfGfGTL8,925
79
79
  strawberry/experimental/pydantic/error_type.py,sha256=NdiaAv2zlaNKfzw0vGgG0lOLTfXAM8gQMk2LsfE7bI4,4555
80
80
  strawberry/experimental/pydantic/exceptions.py,sha256=pDMPL94ojuSGHxk8H8mI2pfWReG8BhqZ5T2eSxfOi9w,1486
81
81
  strawberry/experimental/pydantic/fields.py,sha256=NcB38JYk29fPwJWtoHkIvwTfqD2Ekf7fJ57GjvvK6mQ,2265
82
- strawberry/experimental/pydantic/object_type.py,sha256=cL0zzme1iJL_M4LTLA8r_VnL9IcgV9jur0AfuS12tCM,12752
83
- strawberry/experimental/pydantic/utils.py,sha256=anIFiMip_s4JZgFdsd98pSv-Y6NYiP9idRxbpsVZ9pk,3933
82
+ strawberry/experimental/pydantic/object_type.py,sha256=O7b5LgQuzmE9EdmX4HPea5ul9lmM-08GS3R4HWf-dEk,12895
83
+ strawberry/experimental/pydantic/utils.py,sha256=URSzmcK2KzNGsLv4RyFdFfJnr-ARNLkkM0D4CjijVQU,4035
84
84
  strawberry/ext/LICENSE,sha256=_oY0TZg0b_sW0--0T44aMTpy2e2zF1Kiyn8E1qDiivo,1249
85
85
  strawberry/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
86
  strawberry/ext/dataclasses/LICENSE,sha256=WZgm35K_3NJwLqxpEHJJi7CWxVrwTumEz5D3Dtd7WnA,13925
@@ -104,7 +104,7 @@ strawberry/extensions/runner.py,sha256=LCUSzKUrwTYhoIr1nS8uFDN15_YEQ_3BFK1zpPfOf
104
104
  strawberry/extensions/tracing/__init__.py,sha256=igoDJBlfh7vGhytJ5njx1qQzpxZOUmdfIaH4j5Kmt3E,1112
105
105
  strawberry/extensions/tracing/apollo.py,sha256=GONBVew2K4j3clAHrVYfIMDQTLAwFtag-uBaYI2yqfk,5900
106
106
  strawberry/extensions/tracing/datadog.py,sha256=-5zVf5JSjujzNJQvpu7EANumhL1qeMET2ffjmaf8AU4,5800
107
- strawberry/extensions/tracing/opentelemetry.py,sha256=4czsWhJnwXbFii3vs4kqKD7r0iOakvnlGr2dlsQ7OwI,7207
107
+ strawberry/extensions/tracing/opentelemetry.py,sha256=Bre5HkUwZwRawSvS8Zlix67g46AaR4_XWA49LArm6UI,7304
108
108
  strawberry/extensions/tracing/utils.py,sha256=tXZNyqfct6YNSWi3GRj4GU1fKQGvSce8ZESfoVeys7U,654
109
109
  strawberry/extensions/utils.py,sha256=sjhxItHzbDhqHtnR63WbE35qzHhTyf9NSffidet79Hc,995
110
110
  strawberry/extensions/validation_cache.py,sha256=D4Jyj7WoUkgp_UH6bo9ytRZbPwJnencbti5Z1GszGhM,1433
@@ -130,8 +130,8 @@ strawberry/file_uploads/scalars.py,sha256=NRDeB7j8aotqIkz9r62ISTf4DrxQxEZYUuHsX5
130
130
  strawberry/file_uploads/utils.py,sha256=-c6TbqUI-Dkb96hWCrZabh6TL2OabBuQNkCarOqgDm4,1181
131
131
  strawberry/flask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
132
132
  strawberry/flask/views.py,sha256=HmkqZrO6KSBSM-yNbJkBR34Q5n7oVsTsuCzt2Og5Zws,6351
133
- strawberry/http/__init__.py,sha256=ElFPdSzecCIEFCyaqvlWVrc_NQCuRaa8CcAj0YlL9Qc,1225
134
- strawberry/http/async_base_view.py,sha256=FqhtxyzidawBaVnsPdHuikhZQ-g1BXC34imzbkPSgsY,19149
133
+ strawberry/http/__init__.py,sha256=BV_JpUwNongW38UzFstM72hDXNUjSxdJm_M96pDFU1c,1122
134
+ strawberry/http/async_base_view.py,sha256=USt2Ife2RZ1WjhwRBD5_5K-qJOz6UIdXiMGhnnd59T4,16350
135
135
  strawberry/http/base.py,sha256=Lz-u5SWg2uQp3l5GMKZDPQuJOR42LXHgjV1PZHwiapE,2373
136
136
  strawberry/http/exceptions.py,sha256=9E2dreS1crRoJVUEPuHyx23NcDELDHNzkAOa-rGv-8I,348
137
137
  strawberry/http/ides.py,sha256=WjU0nsMDgr3Bd1ebWkUEkO2d1hk0dI16mLqXyCHqklA,613
@@ -146,7 +146,7 @@ strawberry/parent.py,sha256=wViSVYl5ADuyy2EGaS98by_iT1ep9xTP2od8NB_EIuw,742
146
146
  strawberry/permission.py,sha256=dSRJMjSCmTlXfvfC24kCSrAk0txTjYKTJ5ZVU5IW91Y,7537
147
147
  strawberry/printer/__init__.py,sha256=DmepjmgtkdF5RxK_7yC6qUyRWn56U-9qeZMbkztYB9w,62
148
148
  strawberry/printer/ast_from_value.py,sha256=Tkme60qlykbN2m3dNPNMOe65X-wj6EmcDQwgQv7gUkc,4987
149
- strawberry/printer/printer.py,sha256=IYAyVjH4KcSiuUSGtKjP3CXoH4fFL24UT_WhDcVbtVc,18836
149
+ strawberry/printer/printer.py,sha256=bQ1y8QGSfigU4L-oKi6Akr8LQ75KpUt_WLlp81QFnDE,18800
150
150
  strawberry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
151
  strawberry/quart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
152
152
  strawberry/quart/views.py,sha256=FmzvRA8xjtOz2ZqxwyX10OIDxvnhncPYjywXdFJ037k,4447
@@ -162,13 +162,12 @@ strawberry/sanic/utils.py,sha256=73lkICa7ZMJvXpcNaIhoKsDkdIA7amOCiV6DN_ib7qY,106
162
162
  strawberry/sanic/views.py,sha256=-X3mKtcqxS6_4OZ7DU5PgoLfd5ebsoQXOsG8ZHE_TV0,7067
163
163
  strawberry/scalars.py,sha256=FcFTbu-yKbBfPCuAfXNa6DbTbEzF3eiQHs5nlt6GJdM,2234
164
164
  strawberry/schema/__init__.py,sha256=u1QCyDVQExUVDA20kyosKPz3TS5HMCN2NrXclhiFAL4,92
165
- strawberry/schema/_graphql_core.py,sha256=XHsNZLkCyiH55jANK4XJIjq6VCMhN_MgZBEFWEYj5Jc,1237
166
165
  strawberry/schema/base.py,sha256=q5UAw6do4Ele5Cf8dNAouiPjNmZoCBNFqh5Vl05caCI,3864
167
166
  strawberry/schema/compat.py,sha256=9qJ0lhYJeaN43ayFgVz708ZMvedBhofiTSw9kpFqmjU,1830
168
- strawberry/schema/config.py,sha256=Nl-CWXlKyzcC0ZHoeJmGMXT5jPieC87NU7OqUltbAIk,984
167
+ strawberry/schema/config.py,sha256=6BpCbNNCuekGgiKEPt2mliMqLH_wIjJmSW0tLbnJwk4,924
169
168
  strawberry/schema/exceptions.py,sha256=rqVNb_oYrKM0dHPgvAemqCG6Um282LPPu4zwQ5cZqs4,584
170
169
  strawberry/schema/name_converter.py,sha256=1rrpch-wBidlWfZ7hVouvIIhJpdxWfB5tWnO6PqYug8,6544
171
- strawberry/schema/schema.py,sha256=rClAsHgys69qtlGFEDcpivPDYRHJTHzkxKVld3uwf0o,35534
170
+ strawberry/schema/schema.py,sha256=bbJL5dQRiaeo6DHeztTbF2u8VkSNAnVqraV1SSauHk8,34396
172
171
  strawberry/schema/schema_converter.py,sha256=-_QZCcmHWIEjRPqEChtPMPbFtgz6YmLn8V6KXvZJMOk,37192
173
172
  strawberry/schema/types/__init__.py,sha256=oHO3COWhL3L1KLYCJNY1XFf5xt2GGtHiMC-UaYbFfnA,68
174
173
  strawberry/schema/types/base_scalars.py,sha256=JRUq0WjEkR9dFewstZnqnZKp0uOEipo4UXNF5dzRf4M,1971
@@ -180,9 +179,8 @@ strawberry/schema_codegen/__init__.py,sha256=mN4Qmu5Iakht6nHpRpt9hCs8e--oTPlVtDJ
180
179
  strawberry/schema_directive.py,sha256=CbjdX54EIeWGkJu4SgiLR8mph5_8wyNsgJk2oLoQK_0,2023
181
180
  strawberry/schema_directives.py,sha256=KGKFWCODjm1Ah9qNV_bBwbic7Mld4qLWnWQkev-PG8A,175
182
181
  strawberry/static/apollo-sandbox.html,sha256=2XzkbE0dqsFHqehE-jul9_J9TFOpwA6Ylrlo0Kdx_9w,973
183
- strawberry/static/graphiql.html,sha256=0e3pvTnAet-lNEqA_pgJ8Ak2CdMt34zPKMMMzpAkEVU,4257
182
+ strawberry/static/graphiql.html,sha256=BkiqZlC63f1sHBDs_UpMzcibcNrHKh7K41Sp23yttfo,4257
184
183
  strawberry/static/pathfinder.html,sha256=0DPx9AmJ2C_sJstFXnWOz9k5tVQHeHaK7qdVY4lAlmk,1547
185
- strawberry/streamable.py,sha256=ylfMt5lfX7RRKGi86wWokvIgYQk5jZCvQVc3shK0epk,645
186
184
  strawberry/subscriptions/__init__.py,sha256=1VGmiCzFepqRFyCikagkUoHHdoTG3XYlFu9GafoQMws,170
187
185
  strawberry/subscriptions/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
188
186
  strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py,sha256=wN6dkMu6WiaIZTE19PGoN9xXpIN_RdDE_q7F7ZgjCxk,138
@@ -230,8 +228,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
230
228
  strawberry/utils/operation.py,sha256=SSXxN-vMqdHO6W2OZtip-1z7y4_A-eTVFdhDvhKeLCk,1193
231
229
  strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
232
230
  strawberry/utils/typing.py,sha256=Ux0Hl46lhuXvOKK-C5hj6nlz3zDn8P4CUGH2nUVD2vU,13373
233
- strawberry_graphql-0.263.0.dev1743582446.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
234
- strawberry_graphql-0.263.0.dev1743582446.dist-info/METADATA,sha256=73gMhx8_cf8CTQ1R9ZUYPqZZyKDtMAbSMAsizaroWpg,7693
235
- strawberry_graphql-0.263.0.dev1743582446.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
236
- strawberry_graphql-0.263.0.dev1743582446.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
237
- strawberry_graphql-0.263.0.dev1743582446.dist-info/RECORD,,
231
+ strawberry_graphql-0.263.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
232
+ strawberry_graphql-0.263.1.dist-info/METADATA,sha256=SJpBy1sJMTPHcT_fQNlAs6sK1xMsxT4PIiYieF1U9Jc,7679
233
+ strawberry_graphql-0.263.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
234
+ strawberry_graphql-0.263.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
235
+ strawberry_graphql-0.263.1.dist-info/RECORD,,
@@ -1,46 +0,0 @@
1
- from typing import Union
2
-
3
- from graphql.execution import ExecutionContext as GraphQLExecutionContext
4
- from graphql.execution import ExecutionResult as GraphQLExecutionResult
5
- from graphql.execution import execute, subscribe
6
-
7
- from strawberry.types import ExecutionResult
8
-
9
- try:
10
- from graphql import (
11
- ExperimentalIncrementalExecutionResults as GraphQLIncrementalExecutionResults,
12
- )
13
- from graphql.execution import experimental_execute_incrementally
14
- from graphql.type.directives import (
15
- GraphQLDeferDirective,
16
- GraphQLStreamDirective,
17
- )
18
-
19
- incremental_execution_directives = (
20
- GraphQLDeferDirective,
21
- GraphQLStreamDirective,
22
- )
23
-
24
- except ImportError:
25
- GraphQLIncrementalExecutionResults = type(None)
26
-
27
- incremental_execution_directives = []
28
- experimental_execute_incrementally = None
29
-
30
-
31
- # TODO: give this a better name, maybe also a better place
32
- ResultType = Union[
33
- GraphQLExecutionResult,
34
- GraphQLIncrementalExecutionResults,
35
- ExecutionResult,
36
- ]
37
-
38
- __all__ = [
39
- "GraphQLExecutionContext",
40
- "GraphQLIncrementalExecutionResults",
41
- "ResultType",
42
- "execute",
43
- "experimental_execute_incrementally",
44
- "incremental_execution_directives",
45
- "subscribe",
46
- ]
strawberry/streamable.py DELETED
@@ -1,36 +0,0 @@
1
- from collections.abc import AsyncGenerator
2
- from typing import Annotated, TypeVar
3
-
4
-
5
- class StrawberryStreamable: ...
6
-
7
-
8
- T = TypeVar("T")
9
-
10
- Streamable = Annotated[AsyncGenerator[T, None], StrawberryStreamable()]
11
- """Represents a list that can be streamed using @stream.
12
-
13
- Example:
14
-
15
- ```python
16
- import strawberry
17
- from dataclasses import dataclass
18
-
19
-
20
- @strawberry.type
21
- class Comment:
22
- id: strawberry.ID
23
- content: str
24
-
25
-
26
- @strawberry.type
27
- class Article:
28
- @strawberry.field
29
- @staticmethod
30
- async def comments() -> strawberry.Streamable[Comment]:
31
- for comment in fetch_comments():
32
- yield comment
33
- ```
34
- """
35
-
36
- __all__ = ["Streamable"]