strawberry-graphql 0.237.2__tar.gz → 0.238.0__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 (254) hide show
  1. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/PKG-INFO +1 -3
  2. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/pyproject.toml +2 -6
  3. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/aiohttp/views.py +2 -0
  4. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/asgi/__init__.py +3 -3
  5. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/tracing/sentry.py +1 -1
  6. strawberry_graphql-0.237.2/strawberry/starlite/__init__.py +0 -3
  7. strawberry_graphql-0.237.2/strawberry/starlite/controller.py +0 -387
  8. strawberry_graphql-0.237.2/strawberry/starlite/handlers/graphql_transport_ws_handler.py +0 -59
  9. strawberry_graphql-0.237.2/strawberry/starlite/handlers/graphql_ws_handler.py +0 -64
  10. strawberry_graphql-0.237.2/strawberry/utils/__init__.py +0 -0
  11. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/LICENSE +0 -0
  12. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/README.md +0 -0
  13. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/__init__.py +0 -0
  14. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/__main__.py +0 -0
  15. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/aiohttp/__init__.py +0 -0
  16. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/aiohttp/handlers/__init__.py +0 -0
  17. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/aiohttp/handlers/graphql_transport_ws_handler.py +0 -0
  18. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/aiohttp/handlers/graphql_ws_handler.py +0 -0
  19. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/aiohttp/test/__init__.py +0 -0
  20. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/aiohttp/test/client.py +0 -0
  21. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/annotation.py +0 -0
  22. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/asgi/handlers/__init__.py +0 -0
  23. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/asgi/handlers/graphql_transport_ws_handler.py +0 -0
  24. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/asgi/handlers/graphql_ws_handler.py +0 -0
  25. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/asgi/test/__init__.py +0 -0
  26. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/asgi/test/client.py +0 -0
  27. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/chalice/__init__.py +0 -0
  28. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/chalice/views.py +0 -0
  29. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/__init__.py +0 -0
  30. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/handlers/__init__.py +0 -0
  31. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/handlers/base.py +0 -0
  32. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/handlers/graphql_transport_ws_handler.py +0 -0
  33. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/handlers/graphql_ws_handler.py +0 -0
  34. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/handlers/http_handler.py +0 -0
  35. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/handlers/ws_handler.py +0 -0
  36. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/router.py +0 -0
  37. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/channels/testing.py +0 -0
  38. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/__init__.py +0 -0
  39. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/app.py +0 -0
  40. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/commands/__init__.py +0 -0
  41. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/commands/codegen.py +0 -0
  42. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/commands/export_schema.py +0 -0
  43. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/commands/schema_codegen.py +0 -0
  44. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/commands/server.py +0 -0
  45. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/commands/upgrade/__init__.py +0 -0
  46. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
  47. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
  48. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/constants.py +0 -0
  49. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/debug_server.py +0 -0
  50. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/utils/__init__.py +0 -0
  51. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/cli/utils/load_schema.py +0 -0
  52. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codegen/__init__.py +0 -0
  53. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codegen/exceptions.py +0 -0
  54. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codegen/plugins/__init__.py +0 -0
  55. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codegen/plugins/print_operation.py +0 -0
  56. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codegen/plugins/python.py +0 -0
  57. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codegen/plugins/typescript.py +0 -0
  58. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codegen/query_codegen.py +0 -0
  59. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codegen/types.py +0 -0
  60. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codemods/__init__.py +0 -0
  61. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codemods/annotated_unions.py +0 -0
  62. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/codemods/update_imports.py +0 -0
  63. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/dataloader.py +0 -0
  64. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/directive.py +0 -0
  65. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/django/__init__.py +0 -0
  66. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/django/apps.py +0 -0
  67. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/django/context.py +0 -0
  68. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/django/test/__init__.py +0 -0
  69. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/django/test/client.py +0 -0
  70. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/django/views.py +0 -0
  71. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/__init__.py +0 -0
  72. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/conflicting_arguments.py +0 -0
  73. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/duplicated_type_name.py +0 -0
  74. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/exception.py +0 -0
  75. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/exception_source.py +0 -0
  76. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/handler.py +0 -0
  77. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/invalid_argument_type.py +0 -0
  78. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/invalid_union_type.py +0 -0
  79. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
  80. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/missing_dependencies.py +0 -0
  81. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/missing_field_annotation.py +0 -0
  82. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/missing_return_annotation.py +0 -0
  83. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/not_a_strawberry_enum.py +0 -0
  84. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/object_is_not_a_class.py +0 -0
  85. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
  86. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
  87. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/private_strawberry_field.py +0 -0
  88. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/scalar_already_registered.py +0 -0
  89. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/syntax.py +0 -0
  90. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/unresolved_field_type.py +0 -0
  91. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/utils/__init__.py +0 -0
  92. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/exceptions/utils/source_finder.py +0 -0
  93. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/__init__.py +0 -0
  94. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/__init__.py +0 -0
  95. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/_compat.py +0 -0
  96. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/conversion.py +0 -0
  97. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/conversion_types.py +0 -0
  98. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/error_type.py +0 -0
  99. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/exceptions.py +0 -0
  100. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/fields.py +0 -0
  101. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/object_type.py +0 -0
  102. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/experimental/pydantic/utils.py +0 -0
  103. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/ext/LICENSE +0 -0
  104. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/ext/__init__.py +0 -0
  105. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/ext/dataclasses/LICENSE +0 -0
  106. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/ext/dataclasses/__init__.py +0 -0
  107. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/ext/dataclasses/dataclasses.py +0 -0
  108. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/ext/mypy_plugin.py +0 -0
  109. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/__init__.py +0 -0
  110. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/add_validation_rules.py +0 -0
  111. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/base_extension.py +0 -0
  112. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/context.py +0 -0
  113. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/directives.py +0 -0
  114. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/disable_validation.py +0 -0
  115. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/field_extension.py +0 -0
  116. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/mask_errors.py +0 -0
  117. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/max_aliases.py +0 -0
  118. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/max_tokens.py +0 -0
  119. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/parser_cache.py +0 -0
  120. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/pyinstrument.py +0 -0
  121. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/query_depth_limiter.py +0 -0
  122. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/runner.py +0 -0
  123. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/tracing/__init__.py +0 -0
  124. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/tracing/apollo.py +0 -0
  125. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/tracing/datadog.py +0 -0
  126. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/tracing/opentelemetry.py +0 -0
  127. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/tracing/utils.py +0 -0
  128. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/utils.py +0 -0
  129. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/extensions/validation_cache.py +0 -0
  130. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/fastapi/__init__.py +0 -0
  131. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/fastapi/context.py +0 -0
  132. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/fastapi/handlers/__init__.py +0 -0
  133. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/fastapi/handlers/graphql_transport_ws_handler.py +0 -0
  134. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/fastapi/handlers/graphql_ws_handler.py +0 -0
  135. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/fastapi/router.py +0 -0
  136. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/__init__.py +0 -0
  137. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/argument.py +0 -0
  138. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/enum.py +0 -0
  139. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/field.py +0 -0
  140. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/mutation.py +0 -0
  141. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/object_type.py +0 -0
  142. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/scalar.py +0 -0
  143. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/schema.py +0 -0
  144. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/schema_directive.py +0 -0
  145. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/schema_directives.py +0 -0
  146. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/types.py +0 -0
  147. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/federation/union.py +0 -0
  148. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/field_extensions/__init__.py +0 -0
  149. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/field_extensions/input_mutation.py +0 -0
  150. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/file_uploads/__init__.py +0 -0
  151. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/file_uploads/scalars.py +0 -0
  152. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/file_uploads/utils.py +0 -0
  153. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/flask/__init__.py +0 -0
  154. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/flask/views.py +0 -0
  155. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/__init__.py +0 -0
  156. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/async_base_view.py +0 -0
  157. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/base.py +0 -0
  158. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/exceptions.py +0 -0
  159. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/ides.py +0 -0
  160. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/sync_base_view.py +0 -0
  161. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/temporal_response.py +0 -0
  162. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/types.py +0 -0
  163. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/http/typevars.py +0 -0
  164. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/litestar/__init__.py +0 -0
  165. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/litestar/controller.py +0 -0
  166. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/litestar/handlers/__init__.py +0 -0
  167. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/litestar/handlers/graphql_transport_ws_handler.py +0 -0
  168. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/litestar/handlers/graphql_ws_handler.py +0 -0
  169. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/parent.py +0 -0
  170. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/permission.py +0 -0
  171. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/printer/__init__.py +0 -0
  172. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/printer/ast_from_value.py +0 -0
  173. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/printer/printer.py +0 -0
  174. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/py.typed +0 -0
  175. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/quart/__init__.py +0 -0
  176. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/quart/views.py +0 -0
  177. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/relay/__init__.py +0 -0
  178. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/relay/exceptions.py +0 -0
  179. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/relay/fields.py +0 -0
  180. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/relay/types.py +0 -0
  181. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/relay/utils.py +0 -0
  182. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/resolvers.py +0 -0
  183. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/sanic/__init__.py +0 -0
  184. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/sanic/context.py +0 -0
  185. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/sanic/utils.py +0 -0
  186. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/sanic/views.py +0 -0
  187. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/scalars.py +0 -0
  188. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/__init__.py +0 -0
  189. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/base.py +0 -0
  190. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/compat.py +0 -0
  191. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/config.py +0 -0
  192. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/exceptions.py +0 -0
  193. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/execute.py +0 -0
  194. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/name_converter.py +0 -0
  195. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/schema.py +0 -0
  196. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/schema_converter.py +0 -0
  197. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/types/__init__.py +0 -0
  198. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/types/base_scalars.py +0 -0
  199. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/types/concrete_type.py +0 -0
  200. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/types/scalar.py +0 -0
  201. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/validation_rules/__init__.py +0 -0
  202. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema/validation_rules/one_of.py +0 -0
  203. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema_codegen/__init__.py +0 -0
  204. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema_directive.py +0 -0
  205. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/schema_directives.py +0 -0
  206. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/static/apollo-sandbox.html +0 -0
  207. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/static/graphiql.html +0 -0
  208. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/static/pathfinder.html +0 -0
  209. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/subscriptions/__init__.py +0 -0
  210. {strawberry_graphql-0.237.2/strawberry/starlite/handlers → strawberry_graphql-0.238.0/strawberry/subscriptions/protocols}/__init__.py +0 -0
  211. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
  212. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
  213. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
  214. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
  215. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
  216. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
  217. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/test/__init__.py +0 -0
  218. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/test/client.py +0 -0
  219. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/tools/__init__.py +0 -0
  220. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/tools/create_type.py +0 -0
  221. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/tools/merge_types.py +0 -0
  222. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/__init__.py +0 -0
  223. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/arguments.py +0 -0
  224. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/auto.py +0 -0
  225. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/base.py +0 -0
  226. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/enum.py +0 -0
  227. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/execution.py +0 -0
  228. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/field.py +0 -0
  229. {strawberry_graphql-0.237.2/strawberry/subscriptions/protocols → strawberry_graphql-0.238.0/strawberry/types/fields}/__init__.py +0 -0
  230. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/fields/resolver.py +0 -0
  231. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/graphql.py +0 -0
  232. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/info.py +0 -0
  233. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/lazy_type.py +0 -0
  234. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/mutation.py +0 -0
  235. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/nodes.py +0 -0
  236. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/object_type.py +0 -0
  237. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/private.py +0 -0
  238. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/scalar.py +0 -0
  239. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/type_resolver.py +0 -0
  240. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/union.py +0 -0
  241. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/types/unset.py +0 -0
  242. {strawberry_graphql-0.237.2/strawberry/types/fields → strawberry_graphql-0.238.0/strawberry/utils}/__init__.py +0 -0
  243. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/aio.py +0 -0
  244. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/await_maybe.py +0 -0
  245. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/dataclasses.py +0 -0
  246. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/debug.py +0 -0
  247. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/deprecations.py +0 -0
  248. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/graphql_lexer.py +0 -0
  249. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/importer.py +0 -0
  250. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/inspect.py +0 -0
  251. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/logging.py +0 -0
  252. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/operation.py +0 -0
  253. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/str_converters.py +0 -0
  254. {strawberry_graphql-0.237.2 → strawberry_graphql-0.238.0}/strawberry/utils/typing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.237.2
3
+ Version: 0.238.0
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -35,7 +35,6 @@ Provides-Extra: pydantic
35
35
  Provides-Extra: pyinstrument
36
36
  Provides-Extra: quart
37
37
  Provides-Extra: sanic
38
- Provides-Extra: starlite
39
38
  Requires-Dist: Django (>=3.2) ; extra == "django"
40
39
  Requires-Dist: aiohttp (>=3.7.4.post0,<4.0.0) ; extra == "aiohttp"
41
40
  Requires-Dist: asgiref (>=3.2,<4.0) ; extra == "django" or extra == "channels"
@@ -59,7 +58,6 @@ Requires-Dist: quart (>=0.19.3) ; extra == "quart"
59
58
  Requires-Dist: rich (>=12.0.0) ; extra == "debug" or extra == "debug-server" or extra == "cli"
60
59
  Requires-Dist: sanic (>=20.12.2) ; extra == "sanic"
61
60
  Requires-Dist: starlette (>=0.18.0) ; extra == "asgi" or extra == "debug-server"
62
- Requires-Dist: starlite (>=1.48.0) ; (python_version >= "3.8") and (extra == "starlite")
63
61
  Requires-Dist: typer (>=0.7.0) ; extra == "debug-server" or extra == "cli"
64
62
  Requires-Dist: typing-extensions (>=4.5.0)
65
63
  Requires-Dist: uvicorn (>=0.11.6) ; extra == "debug-server"
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "strawberry-graphql"
3
3
  packages = [ { include = "strawberry" } ]
4
- version = "0.237.2"
4
+ version = "0.238.0"
5
5
  description = "A library for creating GraphQL APIs"
6
6
  authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
7
7
  license = "MIT"
@@ -54,7 +54,6 @@ python-multipart = {version = ">=0.0.7", optional = true}
54
54
  sanic = {version = ">=20.12.2", optional = true}
55
55
  aiohttp = {version = "^3.7.4.post0", optional = true}
56
56
  fastapi = {version = ">=0.65.2", optional = true}
57
- starlite = {version = ">=1.48.0", optional = true, python = ">=3.8"}
58
57
  litestar = {version = ">=2", optional = true, python = ">=3.8"}
59
58
  channels = {version = ">=3.0.5", optional = true}
60
59
  astunparse = {version = "^1.6.3", python = "<3.9"}
@@ -70,7 +69,7 @@ email-validator = {version = ">=1.1.3,<3.0.0", optional = false}
70
69
  freezegun = "^1.2.1"
71
70
  libcst = {version = ">=1.0.0", optional = false}
72
71
  MarkupSafe = "2.1.3"
73
- nox = "^2023.4.22"
72
+ nox = "^2024.4.15"
74
73
  nox-poetry = "^1.0.3"
75
74
  opentelemetry-api = "<2"
76
75
  opentelemetry-sdk = "<2"
@@ -120,7 +119,6 @@ pytest-aiohttp = "^1.0.3"
120
119
  pytest-django = {version = "^4.5"}
121
120
  sanic = ">=20.12.2"
122
121
  starlette = ">=0.13.6"
123
- starlite = {version = ">=1.48.0", optional = false, python = ">=3.8", extras = ["testing"]}
124
122
  litestar = {version = ">=2", optional = false, python = ">=3.8"}
125
123
  uvicorn = ">=0.11.6"
126
124
  daphne = "^4.0.0"
@@ -140,7 +138,6 @@ sanic = ["sanic"]
140
138
  fastapi = ["fastapi", "python-multipart"]
141
139
  chalice = ["chalice"]
142
140
  cli = ["typer", "pygments", "rich", "libcst", "graphlib_backport"]
143
- starlite = ["starlite"]
144
141
  litestar = ["litestar"]
145
142
  pyinstrument = ["pyinstrument"]
146
143
 
@@ -166,7 +163,6 @@ markers = [
166
163
  "relay",
167
164
  "sanic",
168
165
  "starlette",
169
- "starlite",
170
166
  ]
171
167
  asyncio_mode = "auto"
172
168
  filterwarnings = [
@@ -15,6 +15,7 @@ from typing import (
15
15
  )
16
16
 
17
17
  from aiohttp import web
18
+ from aiohttp.multipart import BodyPartReader
18
19
  from strawberry.aiohttp.handlers import (
19
20
  GraphQLTransportWSHandler,
20
21
  GraphQLWSHandler,
@@ -60,6 +61,7 @@ class AioHTTPRequestAdapter(AsyncHTTPRequestAdapter):
60
61
  files: Dict[str, Any] = {}
61
62
 
62
63
  async for field in reader:
64
+ assert isinstance(field, BodyPartReader)
63
65
  assert field.name
64
66
 
65
67
  if field.filename:
@@ -117,12 +117,12 @@ class GraphQL(
117
117
  else:
118
118
  self.graphql_ide = graphql_ide
119
119
 
120
- async def __call__(self, scope: Request, receive: Receive, send: Send) -> None:
120
+ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
121
121
  if scope["type"] == "http":
122
- return await self.handle_http(scope, receive, send) # type: ignore
122
+ return await self.handle_http(scope, receive, send)
123
123
 
124
124
  elif scope["type"] == "websocket":
125
- ws = WebSocket(scope, receive=receive, send=send) # type: ignore
125
+ ws = WebSocket(scope, receive=receive, send=send)
126
126
  preferred_protocol = self.pick_preferred_protocol(ws)
127
127
 
128
128
  if preferred_protocol == GRAPHQL_TRANSPORT_WS_PROTOCOL:
@@ -24,7 +24,7 @@ class SentryTracingExtension(SchemaExtension):
24
24
  execution_context: Optional[ExecutionContext] = None,
25
25
  ) -> None:
26
26
  warnings.warn(
27
- "The Sentry tracing extension is deprecated, please update to sentry>=1.32.0",
27
+ "The Sentry tracing extension is deprecated, please update to sentry-sdk>=1.32.0",
28
28
  DeprecationWarning,
29
29
  stacklevel=2,
30
30
  )
@@ -1,3 +0,0 @@
1
- from strawberry.starlite.controller import BaseContext, make_graphql_controller
2
-
3
- __all__ = ["BaseContext", "make_graphql_controller"]
@@ -1,387 +0,0 @@
1
- """Starlite integration for strawberry-graphql."""
2
-
3
- from __future__ import annotations
4
-
5
- import warnings
6
- from dataclasses import dataclass
7
- from datetime import timedelta
8
- from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Tuple, Union, cast
9
- from typing_extensions import deprecated
10
-
11
- from starlite import (
12
- BackgroundTasks,
13
- Controller,
14
- MediaType,
15
- Provide,
16
- Request,
17
- Response,
18
- WebSocket,
19
- get,
20
- post,
21
- websocket,
22
- )
23
- from starlite.exceptions import (
24
- NotFoundException,
25
- ValidationException,
26
- )
27
- from starlite.status_codes import HTTP_200_OK
28
- from strawberry.exceptions import InvalidCustomContext
29
- from strawberry.http.async_base_view import AsyncBaseHTTPView, AsyncHTTPRequestAdapter
30
- from strawberry.http.exceptions import HTTPException
31
- from strawberry.http.types import FormData, HTTPMethod, QueryParams
32
- from strawberry.http.typevars import (
33
- Context,
34
- RootValue,
35
- )
36
- from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
37
- from strawberry.subscriptions.protocols.graphql_transport_ws import (
38
- WS_4406_PROTOCOL_NOT_ACCEPTABLE,
39
- )
40
-
41
- from .handlers.graphql_transport_ws_handler import (
42
- GraphQLTransportWSHandler as BaseGraphQLTransportWSHandler,
43
- )
44
- from .handlers.graphql_ws_handler import GraphQLWSHandler as BaseGraphQLWSHandler
45
-
46
- if TYPE_CHECKING:
47
- from typing import FrozenSet, List, Type
48
-
49
- from starlite.types import AnyCallable, Dependencies
50
- from strawberry.http import GraphQLHTTPResponse
51
- from strawberry.http.ides import GraphQL_IDE
52
- from strawberry.schema import BaseSchema
53
-
54
- MergedContext = Union[
55
- "BaseContext",
56
- Union[
57
- Dict[str, Any],
58
- Dict[str, BackgroundTasks],
59
- Dict[str, Request[Any, Any]],
60
- Dict[str, Response[Any]],
61
- Dict[str, websocket],
62
- ],
63
- ]
64
-
65
- CustomContext = Union["BaseContext", Dict[str, Any]]
66
-
67
-
68
- async def _context_getter(
69
- custom_context: Optional[CustomContext],
70
- request: Request[Any, Any],
71
- response: Response[Any],
72
- ) -> MergedContext:
73
- if isinstance(custom_context, BaseContext):
74
- custom_context.request = request
75
- return custom_context
76
-
77
- default_context = {
78
- "request": request,
79
- "response": response,
80
- }
81
-
82
- if isinstance(custom_context, dict):
83
- return {
84
- **default_context,
85
- **custom_context,
86
- }
87
-
88
- if custom_context is None:
89
- return default_context
90
-
91
- raise InvalidCustomContext()
92
-
93
-
94
- @dataclass
95
- class GraphQLResource:
96
- data: Optional[Dict[str, object]]
97
- errors: Optional[List[object]]
98
- extensions: Optional[Dict[str, object]]
99
-
100
-
101
- @dataclass
102
- class EmptyResponseModel:
103
- pass
104
-
105
-
106
- class GraphQLWSHandler(BaseGraphQLWSHandler):
107
- async def get_context(self) -> Any:
108
- return await self._get_context()
109
-
110
- async def get_root_value(self) -> Any:
111
- return await self._get_root_value()
112
-
113
-
114
- class GraphQLTransportWSHandler(BaseGraphQLTransportWSHandler):
115
- async def get_context(self) -> Any:
116
- return await self._get_context()
117
-
118
- async def get_root_value(self) -> Any:
119
- return await self._get_root_value()
120
-
121
-
122
- @deprecated(
123
- "The `starlite` integration is deprecated in favor of `litestar` integration",
124
- stacklevel=2,
125
- )
126
- class StarliteRequestAdapter(AsyncHTTPRequestAdapter):
127
- def __init__(self, request: Request[Any, Any]) -> None:
128
- self.request = request
129
-
130
- @property
131
- def query_params(self) -> QueryParams:
132
- return self.request.query_params
133
-
134
- @property
135
- def method(self) -> HTTPMethod:
136
- return cast(HTTPMethod, self.request.method.upper())
137
-
138
- @property
139
- def headers(self) -> Mapping[str, str]:
140
- return self.request.headers
141
-
142
- @property
143
- def content_type(self) -> Optional[str]:
144
- return self.request.content_type[0]
145
-
146
- async def get_body(self) -> bytes:
147
- return await self.request.body()
148
-
149
- async def get_form_data(self) -> FormData:
150
- multipart_data = await self.request.form()
151
-
152
- return FormData(form=multipart_data, files=multipart_data)
153
-
154
-
155
- class BaseContext:
156
- def __init__(self) -> None:
157
- self.request: Optional[Union[Request, WebSocket]] = None
158
- self.response: Optional[Response] = None
159
-
160
-
161
- @deprecated(
162
- "The `starlite` integration is deprecated in favor of `litestar` integration",
163
- stacklevel=2,
164
- )
165
- def make_graphql_controller(
166
- schema: BaseSchema,
167
- path: str = "",
168
- graphiql: Optional[bool] = None,
169
- graphql_ide: Optional[GraphQL_IDE] = "graphiql",
170
- allow_queries_via_get: bool = True,
171
- keep_alive: bool = False,
172
- keep_alive_interval: float = 1,
173
- debug: bool = False,
174
- # TODO: root typevar
175
- root_value_getter: Optional[AnyCallable] = None,
176
- # TODO: context typevar
177
- context_getter: Optional[AnyCallable] = None,
178
- subscription_protocols: Tuple[str, ...] = (
179
- GRAPHQL_TRANSPORT_WS_PROTOCOL,
180
- GRAPHQL_WS_PROTOCOL,
181
- ),
182
- connection_init_wait_timeout: timedelta = timedelta(minutes=1),
183
- ) -> Type[Controller]:
184
- routes_path = path
185
-
186
- if context_getter is None:
187
-
188
- def custom_context_getter_() -> None:
189
- return None
190
-
191
- else:
192
- custom_context_getter_ = context_getter
193
-
194
- if root_value_getter is None:
195
-
196
- def root_value_getter_() -> None:
197
- return None
198
-
199
- else:
200
- root_value_getter_ = root_value_getter
201
-
202
- def response_getter() -> Response[Any]:
203
- return Response({}, background=BackgroundTasks([]))
204
-
205
- schema_ = schema
206
- allow_queries_via_get_ = allow_queries_via_get
207
- graphql_ide_: Optional[GraphQL_IDE]
208
-
209
- if graphiql is not None:
210
- warnings.warn(
211
- "The `graphiql` argument is deprecated in favor of `graphql_ide`",
212
- DeprecationWarning,
213
- stacklevel=2,
214
- )
215
- graphql_ide_ = "graphiql" if graphiql else None
216
- else:
217
- graphql_ide_ = graphql_ide
218
-
219
- class GraphQLController(
220
- Controller,
221
- AsyncBaseHTTPView[
222
- Request[Any, Any], Response[Any], Response[Any], Context, RootValue
223
- ],
224
- ):
225
- request_adapter_class = StarliteRequestAdapter
226
- path: str = routes_path
227
- dependencies: Optional[Dependencies] = {
228
- "custom_context": Provide(custom_context_getter_),
229
- "context": Provide(_context_getter),
230
- "root_value": Provide(root_value_getter_),
231
- "response": Provide(response_getter),
232
- }
233
- graphql_ws_handler_class: Type[GraphQLWSHandler] = GraphQLWSHandler
234
- graphql_transport_ws_handler_class: Type[GraphQLTransportWSHandler] = (
235
- GraphQLTransportWSHandler
236
- )
237
-
238
- _keep_alive: bool = keep_alive
239
- _keep_alive_interval: float = keep_alive_interval
240
- _debug: bool = debug
241
- _protocols: Tuple[str, ...] = subscription_protocols
242
- _connection_init_wait_timeout: timedelta = connection_init_wait_timeout
243
- _graphiql_allowed_accept: FrozenSet[str] = frozenset({"text/html", "*/*"})
244
-
245
- schema: BaseSchema = schema_
246
- allow_queries_via_get = allow_queries_via_get_
247
- graphql_ide = graphql_ide_
248
-
249
- async def execute_request(
250
- self,
251
- request: Request[Any, Any],
252
- context: CustomContext,
253
- root_value: Any,
254
- ) -> Response[Union[GraphQLResource, str]]:
255
- try:
256
- return await self.run(
257
- request,
258
- # TODO: check the dependency, above, can we make it so that
259
- # we don't need to type ignore here?
260
- context=context, # type: ignore
261
- root_value=root_value,
262
- )
263
- except HTTPException as e:
264
- return Response(
265
- e.reason,
266
- status_code=e.status_code,
267
- media_type=MediaType.TEXT,
268
- )
269
-
270
- async def render_graphql_ide(self, request: Request[Any, Any]) -> Response[str]:
271
- return Response(self.graphql_ide_html, media_type=MediaType.HTML)
272
-
273
- def create_response(
274
- self, response_data: GraphQLHTTPResponse, sub_response: Response[bytes]
275
- ) -> Response[bytes]:
276
- response = Response(
277
- self.encode_json(response_data).encode(),
278
- status_code=HTTP_200_OK,
279
- media_type=MediaType.JSON,
280
- )
281
-
282
- response.headers.update(sub_response.headers)
283
- response.cookies.extend(sub_response.cookies)
284
- response.background = sub_response.background
285
-
286
- if sub_response.status_code:
287
- response.status_code = sub_response.status_code
288
-
289
- return response
290
-
291
- @get(raises=[ValidationException, NotFoundException])
292
- async def handle_http_get(
293
- self,
294
- request: Request[Any, Any],
295
- context: CustomContext,
296
- root_value: Any,
297
- response: Response[Any],
298
- ) -> Response[Union[GraphQLResource, str]]:
299
- self.temporal_response = response
300
-
301
- return await self.execute_request(
302
- request=request,
303
- context=context,
304
- root_value=root_value,
305
- )
306
-
307
- @post(status_code=HTTP_200_OK)
308
- async def handle_http_post(
309
- self,
310
- request: Request[Any, Any],
311
- context: CustomContext,
312
- root_value: Any,
313
- response: Response[Any],
314
- ) -> Response[Union[GraphQLResource, str]]:
315
- self.temporal_response = response
316
-
317
- return await self.execute_request(
318
- request=request,
319
- context=context,
320
- root_value=root_value,
321
- )
322
-
323
- async def get_context(
324
- self, request: Request[Any, Any], response: Response[Any]
325
- ) -> Context: # pragma: no cover
326
- raise ValueError("`get_context` is not used by Starlite's controller")
327
-
328
- async def get_root_value(
329
- self, request: Request[Any, Any]
330
- ) -> Optional[RootValue]: # pragma: no cover
331
- raise ValueError("`get_root_value` is not used by Starlite's controller")
332
-
333
- async def get_sub_response(self, request: Request[Any, Any]) -> Response[Any]:
334
- return self.temporal_response
335
-
336
- @websocket()
337
- async def websocket_endpoint(
338
- self,
339
- socket: WebSocket,
340
- context: CustomContext,
341
- root_value: Any,
342
- ) -> None:
343
- async def _get_context() -> CustomContext:
344
- return context
345
-
346
- async def _get_root_value() -> Any:
347
- return root_value
348
-
349
- preferred_protocol = self.pick_preferred_protocol(socket)
350
- if preferred_protocol == GRAPHQL_TRANSPORT_WS_PROTOCOL:
351
- await self.graphql_transport_ws_handler_class(
352
- schema=self.schema,
353
- debug=self._debug,
354
- connection_init_wait_timeout=self._connection_init_wait_timeout,
355
- get_context=_get_context,
356
- get_root_value=_get_root_value,
357
- ws=socket,
358
- ).handle()
359
- elif preferred_protocol == GRAPHQL_WS_PROTOCOL:
360
- await self.graphql_ws_handler_class(
361
- schema=self.schema,
362
- debug=self._debug,
363
- keep_alive=self._keep_alive,
364
- keep_alive_interval=self._keep_alive_interval,
365
- get_context=_get_context,
366
- get_root_value=_get_root_value,
367
- ws=socket,
368
- ).handle()
369
- else:
370
- await socket.close(code=WS_4406_PROTOCOL_NOT_ACCEPTABLE)
371
-
372
- def pick_preferred_protocol(self, socket: WebSocket) -> Optional[str]:
373
- protocols: List[str] = socket.scope["subprotocols"]
374
- intersection = set(protocols) & set(self._protocols)
375
- return (
376
- min(
377
- intersection,
378
- key=lambda i: protocols.index(i) if i else "",
379
- default=None,
380
- )
381
- or None
382
- )
383
-
384
- return GraphQLController
385
-
386
-
387
- __all__ = ["make_graphql_controller"]
@@ -1,59 +0,0 @@
1
- from datetime import timedelta
2
- from typing import Any, Callable
3
-
4
- from starlite import WebSocket
5
- from starlite.exceptions import SerializationException, WebSocketDisconnect
6
- from strawberry.schema import BaseSchema
7
- from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL
8
- from strawberry.subscriptions.protocols.graphql_transport_ws.handlers import (
9
- BaseGraphQLTransportWSHandler,
10
- )
11
-
12
-
13
- class GraphQLTransportWSHandler(BaseGraphQLTransportWSHandler):
14
- def __init__(
15
- self,
16
- schema: BaseSchema,
17
- debug: bool,
18
- connection_init_wait_timeout: timedelta,
19
- get_context: Callable,
20
- get_root_value: Callable,
21
- ws: WebSocket,
22
- ) -> None:
23
- super().__init__(schema, debug, connection_init_wait_timeout)
24
- self._get_context = get_context
25
- self._get_root_value = get_root_value
26
- self._ws = ws
27
-
28
- async def get_context(self) -> Any:
29
- return await self._get_context()
30
-
31
- async def get_root_value(self) -> Any:
32
- return await self._get_root_value()
33
-
34
- async def send_json(self, data: dict) -> None:
35
- await self._ws.send_json(data)
36
-
37
- async def close(self, code: int, reason: str) -> None:
38
- await self._ws.close(code=code, reason=reason)
39
-
40
- async def handle_request(self) -> None:
41
- await self._ws.accept(subprotocols=GRAPHQL_TRANSPORT_WS_PROTOCOL)
42
- self.on_request_accepted()
43
-
44
- try:
45
- while self._ws.connection_state != "disconnect":
46
- try:
47
- message = await self._ws.receive_json()
48
- except (SerializationException, ValueError): # noqa: PERF203
49
- error_message = "WebSocket message type must be text"
50
- await self.handle_invalid_message(error_message)
51
- else:
52
- await self.handle_message(message)
53
- except WebSocketDisconnect: # pragma: no cover
54
- pass
55
- finally:
56
- await self.shutdown()
57
-
58
-
59
- __all__ = ["GraphQLTransportWSHandler"]
@@ -1,64 +0,0 @@
1
- from contextlib import suppress
2
- from typing import Any, Callable, Optional
3
-
4
- from starlite import WebSocket
5
- from starlite.exceptions import SerializationException, WebSocketDisconnect
6
- from strawberry.schema import BaseSchema
7
- from strawberry.subscriptions import GRAPHQL_WS_PROTOCOL
8
- from strawberry.subscriptions.protocols.graphql_ws.handlers import BaseGraphQLWSHandler
9
- from strawberry.subscriptions.protocols.graphql_ws.types import OperationMessage
10
-
11
-
12
- class GraphQLWSHandler(BaseGraphQLWSHandler):
13
- def __init__(
14
- self,
15
- schema: BaseSchema,
16
- debug: bool,
17
- keep_alive: bool,
18
- keep_alive_interval: float,
19
- get_context: Callable,
20
- get_root_value: Callable,
21
- ws: WebSocket,
22
- ) -> None:
23
- super().__init__(schema, debug, keep_alive, keep_alive_interval)
24
- self._get_context = get_context
25
- self._get_root_value = get_root_value
26
- self._ws = ws
27
-
28
- async def get_context(self) -> Any:
29
- return await self._get_context()
30
-
31
- async def get_root_value(self) -> Any:
32
- return await self._get_root_value()
33
-
34
- async def send_json(self, data: OperationMessage) -> None:
35
- await self._ws.send_json(data)
36
-
37
- async def close(self, code: int = 1000, reason: Optional[str] = None) -> None:
38
- await self._ws.close(code=code, reason=reason)
39
-
40
- async def handle_request(self) -> Any:
41
- await self._ws.accept(subprotocols=GRAPHQL_WS_PROTOCOL)
42
-
43
- try:
44
- while self._ws.connection_state != "disconnect":
45
- try:
46
- message = await self._ws.receive_json()
47
- except (SerializationException, ValueError): # noqa: PERF203
48
- # Ignore non-text messages
49
- continue
50
- else:
51
- await self.handle_message(message)
52
- except WebSocketDisconnect: # pragma: no cover
53
- pass
54
- finally:
55
- if self.keep_alive_task:
56
- self.keep_alive_task.cancel()
57
- with suppress(BaseException):
58
- await self.keep_alive_task
59
-
60
- for operation_id in list(self.subscriptions.keys()):
61
- await self.cleanup_operation(operation_id)
62
-
63
-
64
- __all__ = ["GraphQLWSHandler"]
File without changes