strawberry-graphql 0.269.0.dev1747164009__tar.gz → 0.270.1__tar.gz

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.
Files changed (236) hide show
  1. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/PKG-INFO +1 -1
  2. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/pyproject.toml +1 -1
  3. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/async_base_view.py +65 -9
  4. strawberry_graphql-0.270.1/strawberry/quart/views.py +216 -0
  5. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/schema_converter.py +9 -23
  6. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/arguments.py +5 -0
  7. strawberry_graphql-0.269.0.dev1747164009/strawberry/quart/views.py +0 -137
  8. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/LICENSE +0 -0
  9. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/README.md +0 -0
  10. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/__init__.py +0 -0
  11. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/__main__.py +0 -0
  12. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/aiohttp/__init__.py +0 -0
  13. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/aiohttp/test/__init__.py +0 -0
  14. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/aiohttp/test/client.py +0 -0
  15. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/aiohttp/views.py +0 -0
  16. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/annotation.py +0 -0
  17. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/asgi/__init__.py +0 -0
  18. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/asgi/test/__init__.py +0 -0
  19. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/asgi/test/client.py +0 -0
  20. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/chalice/__init__.py +0 -0
  21. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/chalice/views.py +0 -0
  22. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/channels/__init__.py +0 -0
  23. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/channels/handlers/__init__.py +0 -0
  24. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/channels/handlers/base.py +0 -0
  25. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/channels/handlers/http_handler.py +0 -0
  26. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/channels/handlers/ws_handler.py +0 -0
  27. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/channels/router.py +0 -0
  28. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/channels/testing.py +0 -0
  29. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/__init__.py +0 -0
  30. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/app.py +0 -0
  31. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/commands/__init__.py +0 -0
  32. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/commands/codegen.py +0 -0
  33. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/commands/export_schema.py +0 -0
  34. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/commands/schema_codegen.py +0 -0
  35. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/commands/server.py +0 -0
  36. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/commands/upgrade/__init__.py +0 -0
  37. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
  38. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
  39. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/constants.py +0 -0
  40. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/debug_server.py +0 -0
  41. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/utils/__init__.py +0 -0
  42. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/cli/utils/load_schema.py +0 -0
  43. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codegen/__init__.py +0 -0
  44. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codegen/exceptions.py +0 -0
  45. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codegen/plugins/__init__.py +0 -0
  46. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codegen/plugins/print_operation.py +0 -0
  47. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codegen/plugins/python.py +0 -0
  48. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codegen/plugins/typescript.py +0 -0
  49. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codegen/query_codegen.py +0 -0
  50. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codegen/types.py +0 -0
  51. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codemods/__init__.py +0 -0
  52. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codemods/annotated_unions.py +0 -0
  53. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/codemods/update_imports.py +0 -0
  54. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/dataloader.py +0 -0
  55. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/directive.py +0 -0
  56. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/django/__init__.py +0 -0
  57. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/django/apps.py +0 -0
  58. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/django/context.py +0 -0
  59. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/django/test/__init__.py +0 -0
  60. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/django/test/client.py +0 -0
  61. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/django/views.py +0 -0
  62. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/__init__.py +0 -0
  63. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/conflicting_arguments.py +0 -0
  64. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/duplicated_type_name.py +0 -0
  65. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/exception.py +0 -0
  66. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/exception_source.py +0 -0
  67. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/handler.py +0 -0
  68. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/invalid_argument_type.py +0 -0
  69. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/invalid_union_type.py +0 -0
  70. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
  71. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/missing_dependencies.py +0 -0
  72. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/missing_field_annotation.py +0 -0
  73. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/missing_return_annotation.py +0 -0
  74. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/object_is_not_a_class.py +0 -0
  75. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
  76. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
  77. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/private_strawberry_field.py +0 -0
  78. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/scalar_already_registered.py +0 -0
  79. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/syntax.py +0 -0
  80. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/unresolved_field_type.py +0 -0
  81. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/utils/__init__.py +0 -0
  82. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/exceptions/utils/source_finder.py +0 -0
  83. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/__init__.py +0 -0
  84. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/__init__.py +0 -0
  85. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/_compat.py +0 -0
  86. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/conversion.py +0 -0
  87. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/conversion_types.py +0 -0
  88. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/error_type.py +0 -0
  89. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/exceptions.py +0 -0
  90. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/fields.py +0 -0
  91. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/object_type.py +0 -0
  92. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/experimental/pydantic/utils.py +0 -0
  93. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/ext/LICENSE +0 -0
  94. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/ext/__init__.py +0 -0
  95. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/ext/dataclasses/LICENSE +0 -0
  96. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/ext/dataclasses/__init__.py +0 -0
  97. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/ext/dataclasses/dataclasses.py +0 -0
  98. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/ext/mypy_plugin.py +0 -0
  99. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/__init__.py +0 -0
  100. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/add_validation_rules.py +0 -0
  101. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/base_extension.py +0 -0
  102. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/context.py +0 -0
  103. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/directives.py +0 -0
  104. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/disable_validation.py +0 -0
  105. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/field_extension.py +0 -0
  106. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/mask_errors.py +0 -0
  107. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/max_aliases.py +0 -0
  108. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/max_tokens.py +0 -0
  109. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/parser_cache.py +0 -0
  110. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/pyinstrument.py +0 -0
  111. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/query_depth_limiter.py +0 -0
  112. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/runner.py +0 -0
  113. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/tracing/__init__.py +0 -0
  114. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/tracing/apollo.py +0 -0
  115. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/tracing/datadog.py +0 -0
  116. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/tracing/opentelemetry.py +0 -0
  117. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/tracing/utils.py +0 -0
  118. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/utils.py +0 -0
  119. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/extensions/validation_cache.py +0 -0
  120. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/fastapi/__init__.py +0 -0
  121. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/fastapi/context.py +0 -0
  122. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/fastapi/router.py +0 -0
  123. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/__init__.py +0 -0
  124. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/argument.py +0 -0
  125. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/enum.py +0 -0
  126. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/field.py +0 -0
  127. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/mutation.py +0 -0
  128. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/object_type.py +0 -0
  129. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/scalar.py +0 -0
  130. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/schema.py +0 -0
  131. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/schema_directive.py +0 -0
  132. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/schema_directives.py +0 -0
  133. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/types.py +0 -0
  134. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/federation/union.py +0 -0
  135. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/field_extensions/__init__.py +0 -0
  136. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/field_extensions/input_mutation.py +0 -0
  137. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/file_uploads/__init__.py +0 -0
  138. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/file_uploads/scalars.py +0 -0
  139. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/file_uploads/utils.py +0 -0
  140. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/flask/__init__.py +0 -0
  141. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/flask/views.py +0 -0
  142. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/__init__.py +0 -0
  143. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/base.py +0 -0
  144. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/exceptions.py +0 -0
  145. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/ides.py +0 -0
  146. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/parse_content_type.py +0 -0
  147. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/sync_base_view.py +0 -0
  148. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/temporal_response.py +0 -0
  149. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/types.py +0 -0
  150. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/http/typevars.py +0 -0
  151. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/litestar/__init__.py +0 -0
  152. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/litestar/controller.py +0 -0
  153. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/parent.py +0 -0
  154. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/permission.py +0 -0
  155. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/printer/__init__.py +0 -0
  156. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/printer/ast_from_value.py +0 -0
  157. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/printer/printer.py +0 -0
  158. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/py.typed +0 -0
  159. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/quart/__init__.py +0 -0
  160. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/relay/__init__.py +0 -0
  161. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/relay/exceptions.py +0 -0
  162. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/relay/fields.py +0 -0
  163. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/relay/types.py +0 -0
  164. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/relay/utils.py +0 -0
  165. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/resolvers.py +0 -0
  166. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/sanic/__init__.py +0 -0
  167. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/sanic/context.py +0 -0
  168. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/sanic/utils.py +0 -0
  169. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/sanic/views.py +0 -0
  170. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/scalars.py +0 -0
  171. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/__init__.py +0 -0
  172. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/base.py +0 -0
  173. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/compat.py +0 -0
  174. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/config.py +0 -0
  175. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/exceptions.py +0 -0
  176. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/name_converter.py +0 -0
  177. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/schema.py +0 -0
  178. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/types/__init__.py +0 -0
  179. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/types/base_scalars.py +0 -0
  180. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/types/concrete_type.py +0 -0
  181. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/types/scalar.py +0 -0
  182. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/validation_rules/__init__.py +0 -0
  183. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema/validation_rules/one_of.py +0 -0
  184. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema_codegen/__init__.py +0 -0
  185. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema_directive.py +0 -0
  186. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/schema_directives.py +0 -0
  187. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/static/apollo-sandbox.html +0 -0
  188. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/static/graphiql.html +0 -0
  189. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/static/pathfinder.html +0 -0
  190. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/subscriptions/__init__.py +0 -0
  191. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/subscriptions/protocols/__init__.py +0 -0
  192. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
  193. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
  194. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
  195. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
  196. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
  197. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
  198. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/test/__init__.py +0 -0
  199. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/test/client.py +0 -0
  200. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/tools/__init__.py +0 -0
  201. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/tools/create_type.py +0 -0
  202. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/tools/merge_types.py +0 -0
  203. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/__init__.py +0 -0
  204. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/auto.py +0 -0
  205. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/base.py +0 -0
  206. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/cast.py +0 -0
  207. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/enum.py +0 -0
  208. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/execution.py +0 -0
  209. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/field.py +0 -0
  210. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/fields/__init__.py +0 -0
  211. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/fields/resolver.py +0 -0
  212. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/graphql.py +0 -0
  213. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/info.py +0 -0
  214. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/lazy_type.py +0 -0
  215. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/maybe.py +0 -0
  216. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/mutation.py +0 -0
  217. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/nodes.py +0 -0
  218. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/object_type.py +0 -0
  219. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/private.py +0 -0
  220. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/scalar.py +0 -0
  221. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/type_resolver.py +0 -0
  222. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/union.py +0 -0
  223. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/types/unset.py +0 -0
  224. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/__init__.py +0 -0
  225. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/aio.py +0 -0
  226. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/await_maybe.py +0 -0
  227. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/dataclasses.py +0 -0
  228. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/debug.py +0 -0
  229. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/deprecations.py +0 -0
  230. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/graphql_lexer.py +0 -0
  231. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/importer.py +0 -0
  232. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/inspect.py +0 -0
  233. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/logging.py +0 -0
  234. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/operation.py +0 -0
  235. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/str_converters.py +0 -0
  236. {strawberry_graphql-0.269.0.dev1747164009 → strawberry_graphql-0.270.1}/strawberry/utils/typing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.269.0.dev1747164009
3
+ Version: 0.270.1
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "strawberry-graphql"
3
- version = "0.269.0.dev.1747164009"
3
+ version = "0.270.1"
4
4
  packages = [{ include = "strawberry" }]
5
5
  description = "A library for creating GraphQL APIs"
6
6
  authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
@@ -372,26 +372,71 @@ class AsyncBaseHTTPView(
372
372
  )
373
373
 
374
374
  def _stream_with_heartbeat(
375
- self, stream: Callable[[], AsyncGenerator[str, None]]
375
+ self, stream: Callable[[], AsyncGenerator[str, None]], separator: str
376
376
  ) -> Callable[[], AsyncGenerator[str, None]]:
377
- """Adds a heartbeat to the stream, to prevent the connection from closing when there are no messages being sent."""
378
- queue: asyncio.Queue[tuple[bool, Any]] = asyncio.Queue(1)
379
-
377
+ """Add heartbeat messages to a GraphQL stream to prevent connection timeouts.
378
+
379
+ This method wraps an async stream generator with heartbeat functionality by:
380
+ 1. Creating a queue to coordinate between data and heartbeat messages
381
+ 2. Running two concurrent tasks: one for original stream data, one for heartbeats
382
+ 3. Merging both message types into a single output stream
383
+
384
+ Messages in the queue are tuples of (raised, done, data) where:
385
+ - raised (bool): True if this contains an exception to be re-raised
386
+ - done (bool): True if this is the final signal indicating stream completion
387
+ - data: The actual message content to yield, or exception if raised=True
388
+ Note: data is always None when done=True and can be ignored
389
+
390
+ Note: This implementation addresses two critical concerns:
391
+
392
+ 1. Race condition: There's a potential race between checking task.done() and
393
+ processing the final message. We solve this by having the drain task send
394
+ an explicit (False, True, None) completion signal as its final action.
395
+ Without this signal, we might exit before processing the final boundary.
396
+
397
+ Since the queue size is 1 and the drain task will only complete after
398
+ successfully queueing the done signal, task.done() guarantees the done
399
+ signal is either in the queue or has already been processed. This ensures
400
+ we never miss the final boundary.
401
+
402
+ 2. Flow control: The queue has maxsize=1, which is essential because:
403
+ - It provides natural backpressure between producers and consumer
404
+ - Prevents heartbeat messages from accumulating when drain is active
405
+ - Ensures proper task coordination without complex synchronization
406
+ - Guarantees the done signal is queued before drain task completes
407
+
408
+ Heartbeats are sent every 5 seconds when the drain task isn't sending data.
409
+
410
+ Note: Due to the asynchronous nature of the heartbeat task, an extra heartbeat
411
+ message may be sent after the final stream boundary message. This is safe because
412
+ both the MIME specification (RFC 2046) and Apollo's GraphQL Multipart HTTP protocol
413
+ require clients to ignore any content after the final boundary marker. Additionally,
414
+ Apollo's protocol defines heartbeats as empty JSON objects that clients must
415
+ silently ignore.
416
+ """
417
+ queue: asyncio.Queue[tuple[bool, bool, Any]] = asyncio.Queue(
418
+ maxsize=1, # Critical: maxsize=1 for flow control.
419
+ )
380
420
  cancelling = False
381
421
 
382
422
  async def drain() -> None:
383
423
  try:
384
424
  async for item in stream():
385
- await queue.put((False, item))
425
+ await queue.put((False, False, item))
386
426
  except Exception as e:
387
427
  if not cancelling:
388
- await queue.put((True, e))
428
+ await queue.put((True, False, e))
389
429
  else:
390
430
  raise
431
+ # Send completion signal to prevent race conditions. The queue.put()
432
+ # blocks until space is available (due to maxsize=1), guaranteeing that
433
+ # when task.done() is True, the final stream message has been dequeued.
434
+ await queue.put((False, True, None)) # Always use None with done=True
391
435
 
392
436
  async def heartbeat() -> None:
393
437
  while True:
394
- await queue.put((False, self.encode_multipart_data({}, "graphql")))
438
+ item = self.encode_multipart_data({}, separator)
439
+ await queue.put((False, False, item))
395
440
 
396
441
  await asyncio.sleep(5)
397
442
 
@@ -413,8 +458,19 @@ class AsyncBaseHTTPView(
413
458
  await heartbeat_task
414
459
 
415
460
  try:
461
+ # When task.done() is True, the final stream message has been
462
+ # dequeued due to queue size 1 and the blocking nature of queue.put().
416
463
  while not task.done():
417
- raised, data = await queue.get()
464
+ raised, done, data = await queue.get()
465
+
466
+ if done:
467
+ # Received done signal (data is None), stream is complete.
468
+ # Note that we may not get here because of the race between
469
+ # task.done() and queue.get(), but that's OK because if
470
+ # task.done() is True, the actual final message (including any
471
+ # exception) has been consumed. The only intent here is to
472
+ # ensure that data=None is not yielded.
473
+ break
418
474
 
419
475
  if raised:
420
476
  await cancel_tasks()
@@ -439,7 +495,7 @@ class AsyncBaseHTTPView(
439
495
 
440
496
  yield f"\r\n--{separator}--\r\n"
441
497
 
442
- return self._stream_with_heartbeat(stream)
498
+ return self._stream_with_heartbeat(stream, separator)
443
499
 
444
500
  async def parse_multipart_subscriptions(
445
501
  self, request: AsyncHTTPRequestAdapter
@@ -0,0 +1,216 @@
1
+ import asyncio
2
+ import warnings
3
+ from collections.abc import AsyncGenerator, Mapping, Sequence
4
+ from datetime import timedelta
5
+ from json.decoder import JSONDecodeError
6
+ from typing import TYPE_CHECKING, Callable, ClassVar, Optional, Union, cast
7
+ from typing_extensions import TypeGuard
8
+
9
+ from quart import Request, Response, Websocket, request, websocket
10
+ from quart.ctx import has_websocket_context
11
+ from quart.views import View
12
+ from strawberry.http.async_base_view import (
13
+ AsyncBaseHTTPView,
14
+ AsyncHTTPRequestAdapter,
15
+ AsyncWebSocketAdapter,
16
+ )
17
+ from strawberry.http.exceptions import (
18
+ HTTPException,
19
+ NonJsonMessageReceived,
20
+ NonTextMessageReceived,
21
+ WebSocketDisconnected,
22
+ )
23
+ from strawberry.http.ides import GraphQL_IDE
24
+ from strawberry.http.types import FormData, HTTPMethod, QueryParams
25
+ from strawberry.http.typevars import Context, RootValue
26
+ from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
27
+
28
+ if TYPE_CHECKING:
29
+ from quart.typing import ResponseReturnValue
30
+ from strawberry.http import GraphQLHTTPResponse
31
+ from strawberry.schema.base import BaseSchema
32
+
33
+
34
+ class QuartHTTPRequestAdapter(AsyncHTTPRequestAdapter):
35
+ def __init__(self, request: Request) -> None:
36
+ self.request = request
37
+
38
+ @property
39
+ def query_params(self) -> QueryParams:
40
+ return self.request.args.to_dict()
41
+
42
+ @property
43
+ def method(self) -> HTTPMethod:
44
+ return cast("HTTPMethod", self.request.method.upper())
45
+
46
+ @property
47
+ def content_type(self) -> Optional[str]:
48
+ return self.request.content_type
49
+
50
+ @property
51
+ def headers(self) -> Mapping[str, str]:
52
+ return self.request.headers # type: ignore
53
+
54
+ async def get_body(self) -> str:
55
+ return (await self.request.data).decode()
56
+
57
+ async def get_form_data(self) -> FormData:
58
+ files = await self.request.files
59
+ form = await self.request.form
60
+ return FormData(files=files, form=form)
61
+
62
+
63
+ class QuartWebSocketAdapter(AsyncWebSocketAdapter):
64
+ def __init__(
65
+ self, view: AsyncBaseHTTPView, request: Websocket, response: Response
66
+ ) -> None:
67
+ super().__init__(view)
68
+ self.ws = request
69
+
70
+ async def iter_json(
71
+ self, *, ignore_parsing_errors: bool = False
72
+ ) -> AsyncGenerator[object, None]:
73
+ try:
74
+ while True:
75
+ # Raises asyncio.CancelledError when the connection is closed.
76
+ # https://quart.palletsprojects.com/en/latest/how_to_guides/websockets.html#detecting-disconnection
77
+ message = await self.ws.receive()
78
+
79
+ if not isinstance(message, str):
80
+ raise NonTextMessageReceived
81
+
82
+ try:
83
+ yield self.view.decode_json(message)
84
+ except JSONDecodeError as e:
85
+ if not ignore_parsing_errors:
86
+ raise NonJsonMessageReceived from e
87
+ except asyncio.CancelledError:
88
+ pass
89
+
90
+ async def send_json(self, message: Mapping[str, object]) -> None:
91
+ try:
92
+ # Raises asyncio.CancelledError when the connection is closed.
93
+ # https://quart.palletsprojects.com/en/latest/how_to_guides/websockets.html#detecting-disconnection
94
+ await self.ws.send(self.view.encode_json(message))
95
+ except asyncio.CancelledError as exc:
96
+ raise WebSocketDisconnected from exc
97
+
98
+ async def close(self, code: int, reason: str) -> None:
99
+ await self.ws.close(code, reason=reason)
100
+
101
+
102
+ class GraphQLView(
103
+ AsyncBaseHTTPView[
104
+ Request, Response, Response, Websocket, Response, Context, RootValue
105
+ ],
106
+ View,
107
+ ):
108
+ methods: ClassVar[list[str]] = ["GET", "POST"]
109
+ allow_queries_via_get: bool = True
110
+ request_adapter_class = QuartHTTPRequestAdapter
111
+ websocket_adapter_class = QuartWebSocketAdapter
112
+
113
+ def __init__(
114
+ self,
115
+ schema: "BaseSchema",
116
+ graphiql: Optional[bool] = None,
117
+ graphql_ide: Optional[GraphQL_IDE] = "graphiql",
118
+ allow_queries_via_get: bool = True,
119
+ keep_alive: bool = True,
120
+ keep_alive_interval: float = 1,
121
+ debug: bool = False,
122
+ subscription_protocols: Sequence[str] = (
123
+ GRAPHQL_TRANSPORT_WS_PROTOCOL,
124
+ GRAPHQL_WS_PROTOCOL,
125
+ ),
126
+ connection_init_wait_timeout: timedelta = timedelta(minutes=1),
127
+ multipart_uploads_enabled: bool = False,
128
+ ) -> None:
129
+ self.schema = schema
130
+ self.allow_queries_via_get = allow_queries_via_get
131
+ self.keep_alive = keep_alive
132
+ self.keep_alive_interval = keep_alive_interval
133
+ self.debug = debug
134
+ self.subscription_protocols = subscription_protocols
135
+ self.connection_init_wait_timeout = connection_init_wait_timeout
136
+ self.multipart_uploads_enabled = multipart_uploads_enabled
137
+
138
+ if graphiql is not None:
139
+ warnings.warn(
140
+ "The `graphiql` argument is deprecated in favor of `graphql_ide`",
141
+ DeprecationWarning,
142
+ stacklevel=2,
143
+ )
144
+ self.graphql_ide = "graphiql" if graphiql else None
145
+ else:
146
+ self.graphql_ide = graphql_ide
147
+
148
+ async def render_graphql_ide(self, request: Request) -> Response:
149
+ return Response(self.graphql_ide_html)
150
+
151
+ def create_response(
152
+ self, response_data: "GraphQLHTTPResponse", sub_response: Response
153
+ ) -> Response:
154
+ sub_response.set_data(self.encode_json(response_data))
155
+
156
+ return sub_response
157
+
158
+ async def get_context(
159
+ self, request: Union[Request, Websocket], response: Response
160
+ ) -> Context:
161
+ return {"request": request, "response": response} # type: ignore
162
+
163
+ async def get_root_value(
164
+ self, request: Union[Request, Websocket]
165
+ ) -> Optional[RootValue]:
166
+ return None
167
+
168
+ async def get_sub_response(self, request: Request) -> Response:
169
+ return Response(status=200, content_type="application/json")
170
+
171
+ async def dispatch_request(self, **kwargs: object) -> "ResponseReturnValue":
172
+ try:
173
+ return await self.run(
174
+ request=websocket if has_websocket_context() else request
175
+ )
176
+ except HTTPException as e:
177
+ return Response(
178
+ response=e.reason,
179
+ status=e.status_code,
180
+ )
181
+
182
+ async def create_streaming_response(
183
+ self,
184
+ request: Request,
185
+ stream: Callable[[], AsyncGenerator[str, None]],
186
+ sub_response: Response,
187
+ headers: dict[str, str],
188
+ ) -> Response:
189
+ return (
190
+ stream(),
191
+ sub_response.status_code,
192
+ { # type: ignore
193
+ **sub_response.headers,
194
+ **headers,
195
+ },
196
+ )
197
+
198
+ def is_websocket_request(
199
+ self, request: Union[Request, Websocket]
200
+ ) -> TypeGuard[Websocket]:
201
+ return has_websocket_context()
202
+
203
+ async def pick_websocket_subprotocol(self, request: Websocket) -> Optional[str]:
204
+ protocols = request.requested_subprotocols
205
+ intersection = set(protocols) & set(self.subscription_protocols)
206
+ sorted_intersection = sorted(intersection, key=protocols.index)
207
+ return next(iter(sorted_intersection), None)
208
+
209
+ async def create_websocket_response(
210
+ self, request: Websocket, subprotocol: Optional[str]
211
+ ) -> Response:
212
+ await request.accept(subprotocol=subprotocol)
213
+ return Response()
214
+
215
+
216
+ __all__ = ["GraphQLView"]
@@ -270,10 +270,7 @@ class GraphQLCoreConverter:
270
270
  GlobalID,
271
271
  name=global_id_name,
272
272
  description=GraphQLID.description,
273
- parse_literal=lambda v, vars=None: GlobalID.from_id( # noqa: A006
274
- GraphQLID.parse_literal(v, vars)
275
- ),
276
- parse_value=GlobalID.from_id,
273
+ parse_value=lambda v: v,
277
274
  serialize=str,
278
275
  specified_by_url=("https://relay.dev/graphql/objectidentification.htm"),
279
276
  )
@@ -803,6 +800,13 @@ class GraphQLCoreConverter:
803
800
  return _resolver
804
801
 
805
802
  def from_scalar(self, scalar: type) -> GraphQLScalarType:
803
+ from strawberry.relay.types import GlobalID
804
+
805
+ if not self.config.relay_use_legacy_global_id and scalar is GlobalID:
806
+ from strawberry import ID
807
+
808
+ return self.from_scalar(ID)
809
+
806
810
  scalar_definition: ScalarDefinition
807
811
 
808
812
  if scalar in self.scalar_registry:
@@ -817,21 +821,13 @@ class GraphQLCoreConverter:
817
821
 
818
822
  scalar_name = self.config.name_converter.from_type(scalar_definition)
819
823
 
820
- from strawberry.relay import GlobalID
821
-
822
824
  if scalar_name not in self.type_map:
823
- if scalar is GlobalID and hasattr(GraphQLNamedType, "reserved_types"):
824
- GraphQLNamedType.reserved_types.pop("ID")
825
-
826
825
  implementation = (
827
826
  scalar_definition.implementation
828
827
  if scalar_definition.implementation is not None
829
828
  else _make_scalar_type(scalar_definition)
830
829
  )
831
830
 
832
- if scalar is GlobalID and hasattr(GraphQLNamedType, "reserved_types"):
833
- GraphQLNamedType.reserved_types["ID"] = implementation
834
-
835
831
  self.type_map[scalar_name] = ConcreteType(
836
832
  definition=scalar_definition, implementation=implementation
837
833
  )
@@ -841,17 +837,7 @@ class GraphQLCoreConverter:
841
837
  # TODO: the other definition might not be a scalar, we should
842
838
  # handle this case better, since right now we assume it is a scalar
843
839
 
844
- # special case to allow GlobalID to be used as an ID scalar
845
- # TODO: we need to find a better way to handle this, might be
846
- # worth reworking our scalar implementation.
847
- if (
848
- hasattr(other_definition, "origin")
849
- and hasattr(scalar_definition, "origin")
850
- and other_definition.origin == GlobalID
851
- and scalar_definition.origin == GraphQLID
852
- ):
853
- pass
854
- elif other_definition != scalar_definition:
840
+ if other_definition != scalar_definition:
855
841
  other_definition = cast("ScalarDefinition", other_definition)
856
842
 
857
843
  raise ScalarAlreadyRegisteredError(scalar_definition, other_definition)
@@ -170,6 +170,11 @@ def convert_argument(
170
170
  ]
171
171
 
172
172
  if is_scalar(type_, scalar_registry):
173
+ from strawberry.relay.types import GlobalID
174
+
175
+ if type_ is GlobalID:
176
+ return GlobalID.from_id(value) # type: ignore
177
+
173
178
  return value
174
179
 
175
180
  if isinstance(type_, EnumDefinition):
@@ -1,137 +0,0 @@
1
- import warnings
2
- from collections.abc import AsyncGenerator, Mapping
3
- from typing import TYPE_CHECKING, Callable, ClassVar, Optional, cast
4
- from typing_extensions import TypeGuard
5
-
6
- from quart import Request, Response, request
7
- from quart.views import View
8
- from strawberry.http.async_base_view import AsyncBaseHTTPView, AsyncHTTPRequestAdapter
9
- from strawberry.http.exceptions import HTTPException
10
- from strawberry.http.ides import GraphQL_IDE
11
- from strawberry.http.types import FormData, HTTPMethod, QueryParams
12
- from strawberry.http.typevars import Context, RootValue
13
-
14
- if TYPE_CHECKING:
15
- from quart.typing import ResponseReturnValue
16
- from strawberry.http import GraphQLHTTPResponse
17
- from strawberry.schema.base import BaseSchema
18
-
19
-
20
- class QuartHTTPRequestAdapter(AsyncHTTPRequestAdapter):
21
- def __init__(self, request: Request) -> None:
22
- self.request = request
23
-
24
- @property
25
- def query_params(self) -> QueryParams:
26
- return self.request.args.to_dict()
27
-
28
- @property
29
- def method(self) -> HTTPMethod:
30
- return cast("HTTPMethod", self.request.method.upper())
31
-
32
- @property
33
- def content_type(self) -> Optional[str]:
34
- return self.request.content_type
35
-
36
- @property
37
- def headers(self) -> Mapping[str, str]:
38
- return self.request.headers # type: ignore
39
-
40
- async def get_body(self) -> str:
41
- return (await self.request.data).decode()
42
-
43
- async def get_form_data(self) -> FormData:
44
- files = await self.request.files
45
- form = await self.request.form
46
- return FormData(files=files, form=form)
47
-
48
-
49
- class GraphQLView(
50
- AsyncBaseHTTPView[
51
- Request, Response, Response, Request, Response, Context, RootValue
52
- ],
53
- View,
54
- ):
55
- methods: ClassVar[list[str]] = ["GET", "POST"]
56
- allow_queries_via_get: bool = True
57
- request_adapter_class = QuartHTTPRequestAdapter
58
-
59
- def __init__(
60
- self,
61
- schema: "BaseSchema",
62
- graphiql: Optional[bool] = None,
63
- graphql_ide: Optional[GraphQL_IDE] = "graphiql",
64
- allow_queries_via_get: bool = True,
65
- multipart_uploads_enabled: bool = False,
66
- ) -> None:
67
- self.schema = schema
68
- self.allow_queries_via_get = allow_queries_via_get
69
- self.multipart_uploads_enabled = multipart_uploads_enabled
70
-
71
- if graphiql is not None:
72
- warnings.warn(
73
- "The `graphiql` argument is deprecated in favor of `graphql_ide`",
74
- DeprecationWarning,
75
- stacklevel=2,
76
- )
77
- self.graphql_ide = "graphiql" if graphiql else None
78
- else:
79
- self.graphql_ide = graphql_ide
80
-
81
- async def render_graphql_ide(self, request: Request) -> Response:
82
- return Response(self.graphql_ide_html)
83
-
84
- def create_response(
85
- self, response_data: "GraphQLHTTPResponse", sub_response: Response
86
- ) -> Response:
87
- sub_response.set_data(self.encode_json(response_data))
88
-
89
- return sub_response
90
-
91
- async def get_context(self, request: Request, response: Response) -> Context:
92
- return {"request": request, "response": response} # type: ignore
93
-
94
- async def get_root_value(self, request: Request) -> Optional[RootValue]:
95
- return None
96
-
97
- async def get_sub_response(self, request: Request) -> Response:
98
- return Response(status=200, content_type="application/json")
99
-
100
- async def dispatch_request(self) -> "ResponseReturnValue": # type: ignore
101
- try:
102
- return await self.run(request=request)
103
- except HTTPException as e:
104
- return Response(
105
- response=e.reason,
106
- status=e.status_code,
107
- )
108
-
109
- async def create_streaming_response(
110
- self,
111
- request: Request,
112
- stream: Callable[[], AsyncGenerator[str, None]],
113
- sub_response: Response,
114
- headers: dict[str, str],
115
- ) -> Response:
116
- return (
117
- stream(),
118
- sub_response.status_code,
119
- { # type: ignore
120
- **sub_response.headers,
121
- **headers,
122
- },
123
- )
124
-
125
- def is_websocket_request(self, request: Request) -> TypeGuard[Request]:
126
- return False
127
-
128
- async def pick_websocket_subprotocol(self, request: Request) -> Optional[str]:
129
- raise NotImplementedError
130
-
131
- async def create_websocket_response(
132
- self, request: Request, subprotocol: Optional[str]
133
- ) -> Response:
134
- raise NotImplementedError
135
-
136
-
137
- __all__ = ["GraphQLView"]