strawberry-graphql 0.278.0__tar.gz → 0.278.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 (243) hide show
  1. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/PKG-INFO +2 -1
  2. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/pyproject.toml +2 -1
  3. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/aiohttp/views.py +2 -48
  4. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/asgi/__init__.py +2 -37
  5. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/chalice/views.py +4 -39
  6. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/handlers/http_handler.py +30 -6
  7. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/views.py +4 -73
  8. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/fastapi/router.py +8 -4
  9. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/flask/views.py +4 -74
  10. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/async_base_view.py +5 -31
  11. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/base.py +2 -1
  12. strawberry_graphql-0.278.1/strawberry/http/exceptions.py +17 -0
  13. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/sync_base_view.py +1 -34
  14. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/litestar/controller.py +1 -39
  15. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/quart/views.py +3 -33
  16. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/sanic/views.py +4 -43
  17. strawberry_graphql-0.278.0/strawberry/http/exceptions.py +0 -19
  18. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/LICENSE +0 -0
  19. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/README.md +0 -0
  20. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/__init__.py +0 -0
  21. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/__main__.py +0 -0
  22. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/aiohttp/__init__.py +0 -0
  23. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/aiohttp/test/__init__.py +0 -0
  24. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/aiohttp/test/client.py +0 -0
  25. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/annotation.py +0 -0
  26. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/asgi/test/__init__.py +0 -0
  27. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/asgi/test/client.py +0 -0
  28. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/chalice/__init__.py +0 -0
  29. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/__init__.py +0 -0
  30. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/handlers/__init__.py +0 -0
  31. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/handlers/base.py +0 -0
  32. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/handlers/ws_handler.py +0 -0
  33. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/router.py +0 -0
  34. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/testing.py +0 -0
  35. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/__init__.py +0 -0
  36. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/app.py +0 -0
  37. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/__init__.py +0 -0
  38. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/codegen.py +0 -0
  39. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/export_schema.py +0 -0
  40. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/locate_definition.py +0 -0
  41. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/schema_codegen.py +0 -0
  42. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/server.py +0 -0
  43. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/upgrade/__init__.py +0 -0
  44. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
  45. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
  46. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/constants.py +0 -0
  47. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/debug_server.py +0 -0
  48. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/utils/__init__.py +0 -0
  49. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/utils/load_schema.py +0 -0
  50. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/__init__.py +0 -0
  51. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/exceptions.py +0 -0
  52. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/plugins/__init__.py +0 -0
  53. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/plugins/print_operation.py +0 -0
  54. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/plugins/python.py +0 -0
  55. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/plugins/typescript.py +0 -0
  56. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/query_codegen.py +0 -0
  57. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/types.py +0 -0
  58. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codemods/__init__.py +0 -0
  59. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codemods/annotated_unions.py +0 -0
  60. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codemods/update_imports.py +0 -0
  61. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/dataloader.py +0 -0
  62. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/directive.py +0 -0
  63. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/__init__.py +0 -0
  64. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/apps.py +0 -0
  65. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/context.py +0 -0
  66. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/test/__init__.py +0 -0
  67. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/test/client.py +0 -0
  68. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/__init__.py +0 -0
  69. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/conflicting_arguments.py +0 -0
  70. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/duplicated_type_name.py +0 -0
  71. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/exception.py +0 -0
  72. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/exception_source.py +0 -0
  73. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/handler.py +0 -0
  74. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/invalid_argument_type.py +0 -0
  75. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/invalid_superclass_interface.py +0 -0
  76. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/invalid_union_type.py +0 -0
  77. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
  78. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/missing_dependencies.py +0 -0
  79. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/missing_field_annotation.py +0 -0
  80. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/missing_return_annotation.py +0 -0
  81. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/object_is_not_a_class.py +0 -0
  82. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
  83. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
  84. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/private_strawberry_field.py +0 -0
  85. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/scalar_already_registered.py +0 -0
  86. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/syntax.py +0 -0
  87. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/unresolved_field_type.py +0 -0
  88. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/utils/__init__.py +0 -0
  89. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/utils/source_finder.py +0 -0
  90. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/__init__.py +0 -0
  91. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/__init__.py +0 -0
  92. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/_compat.py +0 -0
  93. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/conversion.py +0 -0
  94. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/conversion_types.py +0 -0
  95. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/error_type.py +0 -0
  96. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/exceptions.py +0 -0
  97. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/fields.py +0 -0
  98. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/object_type.py +0 -0
  99. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/utils.py +0 -0
  100. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/LICENSE +0 -0
  101. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/__init__.py +0 -0
  102. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/dataclasses/LICENSE +0 -0
  103. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/dataclasses/README.md +0 -0
  104. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/dataclasses/__init__.py +0 -0
  105. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/dataclasses/dataclasses.py +0 -0
  106. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/mypy_plugin.py +0 -0
  107. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/__init__.py +0 -0
  108. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/add_validation_rules.py +0 -0
  109. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/base_extension.py +0 -0
  110. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/context.py +0 -0
  111. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/directives.py +0 -0
  112. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/disable_introspection.py +0 -0
  113. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/disable_validation.py +0 -0
  114. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/field_extension.py +0 -0
  115. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/mask_errors.py +0 -0
  116. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/max_aliases.py +0 -0
  117. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/max_tokens.py +0 -0
  118. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/parser_cache.py +0 -0
  119. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/pyinstrument.py +0 -0
  120. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/query_depth_limiter.py +0 -0
  121. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/runner.py +0 -0
  122. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/__init__.py +0 -0
  123. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/apollo.py +0 -0
  124. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/datadog.py +0 -0
  125. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/opentelemetry.py +0 -0
  126. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/utils.py +0 -0
  127. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/utils.py +0 -0
  128. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/validation_cache.py +0 -0
  129. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/fastapi/__init__.py +0 -0
  130. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/fastapi/context.py +0 -0
  131. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/__init__.py +0 -0
  132. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/argument.py +0 -0
  133. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/enum.py +0 -0
  134. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/field.py +0 -0
  135. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/mutation.py +0 -0
  136. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/object_type.py +0 -0
  137. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/scalar.py +0 -0
  138. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/schema.py +0 -0
  139. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/schema_directive.py +0 -0
  140. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/schema_directives.py +0 -0
  141. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/types.py +0 -0
  142. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/union.py +0 -0
  143. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/field_extensions/__init__.py +0 -0
  144. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/field_extensions/input_mutation.py +0 -0
  145. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/file_uploads/__init__.py +0 -0
  146. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/file_uploads/scalars.py +0 -0
  147. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/file_uploads/utils.py +0 -0
  148. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/flask/__init__.py +0 -0
  149. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/__init__.py +0 -0
  150. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/ides.py +0 -0
  151. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/parse_content_type.py +0 -0
  152. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/temporal_response.py +0 -0
  153. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/types.py +0 -0
  154. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/typevars.py +0 -0
  155. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/litestar/__init__.py +0 -0
  156. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/parent.py +0 -0
  157. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/permission.py +0 -0
  158. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/printer/__init__.py +0 -0
  159. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/printer/ast_from_value.py +0 -0
  160. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/printer/printer.py +0 -0
  161. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/py.typed +0 -0
  162. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/quart/__init__.py +0 -0
  163. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/__init__.py +0 -0
  164. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/exceptions.py +0 -0
  165. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/fields.py +0 -0
  166. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/types.py +0 -0
  167. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/utils.py +0 -0
  168. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/resolvers.py +0 -0
  169. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/sanic/__init__.py +0 -0
  170. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/sanic/context.py +0 -0
  171. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/sanic/utils.py +0 -0
  172. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/scalars.py +0 -0
  173. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/__init__.py +0 -0
  174. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/_graphql_core.py +0 -0
  175. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/base.py +0 -0
  176. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/compat.py +0 -0
  177. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/config.py +0 -0
  178. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/exceptions.py +0 -0
  179. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/name_converter.py +0 -0
  180. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/schema.py +0 -0
  181. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/schema_converter.py +0 -0
  182. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/types/__init__.py +0 -0
  183. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/types/base_scalars.py +0 -0
  184. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/types/concrete_type.py +0 -0
  185. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/types/scalar.py +0 -0
  186. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/validation_rules/__init__.py +0 -0
  187. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/validation_rules/one_of.py +0 -0
  188. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema_codegen/__init__.py +0 -0
  189. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema_directive.py +0 -0
  190. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema_directives.py +0 -0
  191. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/static/apollo-sandbox.html +0 -0
  192. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/static/graphiql.html +0 -0
  193. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/static/pathfinder.html +0 -0
  194. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/streamable.py +0 -0
  195. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/__init__.py +0 -0
  196. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/__init__.py +0 -0
  197. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
  198. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
  199. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
  200. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
  201. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
  202. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
  203. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/test/__init__.py +0 -0
  204. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/test/client.py +0 -0
  205. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/tools/__init__.py +0 -0
  206. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/tools/create_type.py +0 -0
  207. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/tools/merge_types.py +0 -0
  208. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/__init__.py +0 -0
  209. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/arguments.py +0 -0
  210. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/auto.py +0 -0
  211. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/base.py +0 -0
  212. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/cast.py +0 -0
  213. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/enum.py +0 -0
  214. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/execution.py +0 -0
  215. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/field.py +0 -0
  216. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/fields/__init__.py +0 -0
  217. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/fields/resolver.py +0 -0
  218. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/graphql.py +0 -0
  219. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/info.py +0 -0
  220. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/lazy_type.py +0 -0
  221. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/maybe.py +0 -0
  222. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/mutation.py +0 -0
  223. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/nodes.py +0 -0
  224. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/object_type.py +0 -0
  225. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/private.py +0 -0
  226. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/scalar.py +0 -0
  227. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/type_resolver.py +0 -0
  228. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/union.py +0 -0
  229. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/unset.py +0 -0
  230. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/__init__.py +0 -0
  231. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/aio.py +0 -0
  232. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/await_maybe.py +0 -0
  233. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/dataclasses.py +0 -0
  234. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/debug.py +0 -0
  235. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/deprecations.py +0 -0
  236. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/graphql_lexer.py +0 -0
  237. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/importer.py +0 -0
  238. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/inspect.py +0 -0
  239. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/locate_definition.py +0 -0
  240. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/logging.py +0 -0
  241. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/operation.py +0 -0
  242. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/str_converters.py +0 -0
  243. {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.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.278.0
3
+ Version: 0.278.1
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -37,6 +37,7 @@ Requires-Dist: channels (>=3.0.5) ; extra == "channels"
37
37
  Requires-Dist: fastapi (>=0.65.2) ; extra == "fastapi"
38
38
  Requires-Dist: flask (>=1.1) ; extra == "flask"
39
39
  Requires-Dist: graphql-core (>=3.2.0,<3.4.0)
40
+ Requires-Dist: lia-web (>=0.2.1)
40
41
  Requires-Dist: libcst ; extra == "cli"
41
42
  Requires-Dist: libcst ; extra == "debug"
42
43
  Requires-Dist: libcst ; extra == "debug-server"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "strawberry-graphql"
3
- version = "0.278.0"
3
+ version = "0.278.1"
4
4
  description = "A library for creating GraphQL APIs"
5
5
  authors = [{ name = "Patrick Arminio", email = "patrick.arminio@gmail.com" }]
6
6
  license = { text = "MIT" }
@@ -19,6 +19,7 @@ dependencies = [
19
19
  "typing-extensions>=4.5.0",
20
20
  "python-dateutil~=2.7",
21
21
  "packaging>=23",
22
+ "lia-web (>=0.2.1)",
22
23
  ]
23
24
 
24
25
  [project.urls]
@@ -3,32 +3,27 @@ from __future__ import annotations
3
3
  import asyncio
4
4
  import warnings
5
5
  from datetime import timedelta
6
- from io import BytesIO
7
6
  from json.decoder import JSONDecodeError
8
7
  from typing import (
9
8
  TYPE_CHECKING,
10
- Any,
11
9
  Callable,
12
10
  Optional,
13
11
  Union,
14
- cast,
15
12
  )
16
13
  from typing_extensions import TypeGuard
17
14
 
15
+ from lia import AiohttpHTTPRequestAdapter, HTTPException
16
+
18
17
  from aiohttp import ClientConnectionResetError, http, web
19
- from aiohttp.multipart import BodyPartReader
20
18
  from strawberry.http.async_base_view import (
21
19
  AsyncBaseHTTPView,
22
- AsyncHTTPRequestAdapter,
23
20
  AsyncWebSocketAdapter,
24
21
  )
25
22
  from strawberry.http.exceptions import (
26
- HTTPException,
27
23
  NonJsonMessageReceived,
28
24
  NonTextMessageReceived,
29
25
  WebSocketDisconnected,
30
26
  )
31
- from strawberry.http.types import FormData, HTTPMethod, QueryParams
32
27
  from strawberry.http.typevars import (
33
28
  Context,
34
29
  RootValue,
@@ -43,47 +38,6 @@ if TYPE_CHECKING:
43
38
  from strawberry.schema import BaseSchema
44
39
 
45
40
 
46
- class AiohttpHTTPRequestAdapter(AsyncHTTPRequestAdapter):
47
- def __init__(self, request: web.Request) -> None:
48
- self.request = request
49
-
50
- @property
51
- def query_params(self) -> QueryParams:
52
- return self.request.query.copy() # type: ignore[attr-defined]
53
-
54
- async def get_body(self) -> str:
55
- return (await self.request.content.read()).decode()
56
-
57
- @property
58
- def method(self) -> HTTPMethod:
59
- return cast("HTTPMethod", self.request.method.upper())
60
-
61
- @property
62
- def headers(self) -> Mapping[str, str]:
63
- return self.request.headers
64
-
65
- async def get_form_data(self) -> FormData:
66
- reader = await self.request.multipart()
67
-
68
- data: dict[str, Any] = {}
69
- files: dict[str, Any] = {}
70
-
71
- while field := await reader.next():
72
- assert isinstance(field, BodyPartReader)
73
- assert field.name
74
-
75
- if field.filename:
76
- files[field.name] = BytesIO(await field.read(decode=False))
77
- else:
78
- data[field.name] = await field.text()
79
-
80
- return FormData(files=files, form=data)
81
-
82
- @property
83
- def content_type(self) -> Optional[str]:
84
- return self.headers.get("content-type")
85
-
86
-
87
41
  class AiohttpWebSocketAdapter(AsyncWebSocketAdapter):
88
42
  def __init__(
89
43
  self, view: AsyncBaseHTTPView, request: web.Request, ws: web.WebSocketResponse
@@ -8,10 +8,10 @@ from typing import (
8
8
  Callable,
9
9
  Optional,
10
10
  Union,
11
- cast,
12
11
  )
13
12
  from typing_extensions import TypeGuard
14
13
 
14
+ from lia import HTTPException, StarletteRequestAdapter
15
15
  from starlette import status
16
16
  from starlette.requests import Request
17
17
  from starlette.responses import (
@@ -24,16 +24,13 @@ from starlette.websockets import WebSocket, WebSocketDisconnect, WebSocketState
24
24
 
25
25
  from strawberry.http.async_base_view import (
26
26
  AsyncBaseHTTPView,
27
- AsyncHTTPRequestAdapter,
28
27
  AsyncWebSocketAdapter,
29
28
  )
30
29
  from strawberry.http.exceptions import (
31
- HTTPException,
32
30
  NonJsonMessageReceived,
33
31
  NonTextMessageReceived,
34
32
  WebSocketDisconnected,
35
33
  )
36
- from strawberry.http.types import FormData, HTTPMethod, QueryParams
37
34
  from strawberry.http.typevars import (
38
35
  Context,
39
36
  RootValue,
@@ -50,38 +47,6 @@ if TYPE_CHECKING:
50
47
  from strawberry.schema import BaseSchema
51
48
 
52
49
 
53
- class ASGIRequestAdapter(AsyncHTTPRequestAdapter):
54
- def __init__(self, request: Request) -> None:
55
- self.request = request
56
-
57
- @property
58
- def query_params(self) -> QueryParams:
59
- return self.request.query_params
60
-
61
- @property
62
- def method(self) -> HTTPMethod:
63
- return cast("HTTPMethod", self.request.method.upper())
64
-
65
- @property
66
- def headers(self) -> Mapping[str, str]:
67
- return self.request.headers
68
-
69
- @property
70
- def content_type(self) -> Optional[str]:
71
- return self.request.headers.get("content-type")
72
-
73
- async def get_body(self) -> bytes:
74
- return await self.request.body()
75
-
76
- async def get_form_data(self) -> FormData:
77
- multipart_data = await self.request.form()
78
-
79
- return FormData(
80
- files=multipart_data,
81
- form=multipart_data,
82
- )
83
-
84
-
85
50
  class ASGIWebSocketAdapter(AsyncWebSocketAdapter):
86
51
  def __init__(
87
52
  self, view: AsyncBaseHTTPView, request: WebSocket, response: WebSocket
@@ -127,7 +92,7 @@ class GraphQL(
127
92
  ]
128
93
  ):
129
94
  allow_queries_via_get = True
130
- request_adapter_class = ASGIRequestAdapter
95
+ request_adapter_class = StarletteRequestAdapter
131
96
  websocket_adapter_class = ASGIWebSocketAdapter
132
97
 
133
98
  def __init__(
@@ -1,56 +1,21 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import warnings
4
- from typing import TYPE_CHECKING, Any, Optional, Union, cast
4
+ from typing import TYPE_CHECKING, Optional, Union
5
+
6
+ from lia import ChaliceHTTPRequestAdapter, HTTPException
5
7
 
6
8
  from chalice.app import Request, Response
7
- from strawberry.http.exceptions import HTTPException
8
- from strawberry.http.sync_base_view import SyncBaseHTTPView, SyncHTTPRequestAdapter
9
+ from strawberry.http.sync_base_view import SyncBaseHTTPView
9
10
  from strawberry.http.temporal_response import TemporalResponse
10
11
  from strawberry.http.typevars import Context, RootValue
11
12
 
12
13
  if TYPE_CHECKING:
13
- from collections.abc import Mapping
14
-
15
14
  from strawberry.http import GraphQLHTTPResponse
16
15
  from strawberry.http.ides import GraphQL_IDE
17
- from strawberry.http.types import HTTPMethod, QueryParams
18
16
  from strawberry.schema import BaseSchema
19
17
 
20
18
 
21
- class ChaliceHTTPRequestAdapter(SyncHTTPRequestAdapter):
22
- def __init__(self, request: Request) -> None:
23
- self.request = request
24
-
25
- @property
26
- def query_params(self) -> QueryParams:
27
- return self.request.query_params or {}
28
-
29
- @property
30
- def body(self) -> Union[str, bytes]:
31
- return self.request.raw_body
32
-
33
- @property
34
- def method(self) -> HTTPMethod:
35
- return cast("HTTPMethod", self.request.method.upper())
36
-
37
- @property
38
- def headers(self) -> Mapping[str, str]:
39
- return self.request.headers
40
-
41
- @property
42
- def post_data(self) -> Mapping[str, Union[str, bytes]]:
43
- raise NotImplementedError
44
-
45
- @property
46
- def files(self) -> Mapping[str, Any]:
47
- raise NotImplementedError
48
-
49
- @property
50
- def content_type(self) -> Optional[str]:
51
- return self.request.headers.get("Content-Type", None)
52
-
53
-
54
19
  class GraphQLView(
55
20
  SyncBaseHTTPView[Request, Response, TemporalResponse, Context, RootValue]
56
21
  ):
@@ -12,14 +12,13 @@ from urllib.parse import parse_qs
12
12
  from django.conf import settings
13
13
  from django.core.files import uploadhandler
14
14
  from django.http.multipartparser import MultiPartParser
15
+ from lia import AsyncHTTPRequestAdapter, FormData, HTTPException, SyncHTTPRequestAdapter
15
16
 
16
17
  from channels.db import database_sync_to_async
17
18
  from channels.generic.http import AsyncHttpConsumer
18
- from strawberry.http.async_base_view import AsyncBaseHTTPView, AsyncHTTPRequestAdapter
19
- from strawberry.http.exceptions import HTTPException
20
- from strawberry.http.sync_base_view import SyncBaseHTTPView, SyncHTTPRequestAdapter
19
+ from strawberry.http.async_base_view import AsyncBaseHTTPView
20
+ from strawberry.http.sync_base_view import SyncBaseHTTPView
21
21
  from strawberry.http.temporal_response import TemporalResponse
22
- from strawberry.http.types import FormData
23
22
  from strawberry.http.typevars import Context, RootValue
24
23
  from strawberry.types.unset import UNSET
25
24
 
@@ -127,6 +126,28 @@ class BaseChannelsRequestAdapter:
127
126
  def content_type(self) -> Optional[str]:
128
127
  return self.request.content_type
129
128
 
129
+ @property
130
+ def url(self) -> str:
131
+ scheme = self.request.consumer.scope["scheme"]
132
+ host = self.headers.get("host", "localhost")
133
+ path = self.request.consumer.scope["path"]
134
+ query_string = self.request.consumer.scope["query_string"]
135
+ url = f"{scheme}://{host}{path}"
136
+ if query_string:
137
+ url += f"?{query_string.decode()}"
138
+ return url
139
+
140
+ @property
141
+ def cookies(self) -> Mapping[str, str]:
142
+ cookie_header = self.headers.get("cookie", "")
143
+ cookies = {}
144
+ if cookie_header:
145
+ for cookie in cookie_header.split(";"):
146
+ if "=" in cookie:
147
+ key, value = cookie.split("=", 1)
148
+ cookies[key.strip()] = value.strip()
149
+ return cookies
150
+
130
151
 
131
152
  class ChannelsRequestAdapter(BaseChannelsRequestAdapter, AsyncHTTPRequestAdapter):
132
153
  async def get_body(self) -> bytes:
@@ -143,11 +164,14 @@ class SyncChannelsRequestAdapter(BaseChannelsRequestAdapter, SyncHTTPRequestAdap
143
164
 
144
165
  @property
145
166
  def post_data(self) -> Mapping[str, Union[str, bytes]]:
146
- return self.request.form_data["form"]
167
+ return self.request.form_data.form
147
168
 
148
169
  @property
149
170
  def files(self) -> Mapping[str, Any]:
150
- return self.request.form_data["files"]
171
+ return self.request.form_data.files
172
+
173
+ def get_form_data(self) -> FormData:
174
+ return self.request.form_data
151
175
 
152
176
 
153
177
  class BaseGraphQLHTTPConsumer(ChannelsConsumer, AsyncHttpConsumer):
@@ -8,7 +8,6 @@ from typing import (
8
8
  Callable,
9
9
  Optional,
10
10
  Union,
11
- cast,
12
11
  )
13
12
  from typing_extensions import TypeGuard
14
13
 
@@ -26,11 +25,10 @@ from django.template.exceptions import TemplateDoesNotExist
26
25
  from django.template.loader import render_to_string
27
26
  from django.utils.decorators import classonlymethod
28
27
  from django.views.generic import View
28
+ from lia import AsyncDjangoHTTPRequestAdapter, DjangoHTTPRequestAdapter, HTTPException
29
29
 
30
- from strawberry.http.async_base_view import AsyncBaseHTTPView, AsyncHTTPRequestAdapter
31
- from strawberry.http.exceptions import HTTPException
32
- from strawberry.http.sync_base_view import SyncBaseHTTPView, SyncHTTPRequestAdapter
33
- from strawberry.http.types import FormData, HTTPMethod, QueryParams
30
+ from strawberry.http.async_base_view import AsyncBaseHTTPView
31
+ from strawberry.http.sync_base_view import SyncBaseHTTPView
34
32
  from strawberry.http.typevars import (
35
33
  Context,
36
34
  RootValue,
@@ -39,7 +37,7 @@ from strawberry.http.typevars import (
39
37
  from .context import StrawberryDjangoContext
40
38
 
41
39
  if TYPE_CHECKING:
42
- from collections.abc import AsyncIterator, Mapping
40
+ from collections.abc import AsyncIterator
43
41
 
44
42
  from django.template.response import TemplateResponse
45
43
 
@@ -67,73 +65,6 @@ class TemporalHttpResponse(JsonResponse):
67
65
  )
68
66
 
69
67
 
70
- class DjangoHTTPRequestAdapter(SyncHTTPRequestAdapter):
71
- def __init__(self, request: HttpRequest) -> None:
72
- self.request = request
73
-
74
- @property
75
- def query_params(self) -> QueryParams:
76
- return self.request.GET.dict()
77
-
78
- @property
79
- def body(self) -> Union[str, bytes]:
80
- return self.request.body.decode()
81
-
82
- @property
83
- def method(self) -> HTTPMethod:
84
- assert self.request.method is not None
85
-
86
- return cast("HTTPMethod", self.request.method.upper())
87
-
88
- @property
89
- def headers(self) -> Mapping[str, str]:
90
- return self.request.headers
91
-
92
- @property
93
- def post_data(self) -> Mapping[str, Union[str, bytes]]:
94
- return self.request.POST
95
-
96
- @property
97
- def files(self) -> Mapping[str, Any]:
98
- return self.request.FILES
99
-
100
- @property
101
- def content_type(self) -> Optional[str]:
102
- return self.request.content_type
103
-
104
-
105
- class AsyncDjangoHTTPRequestAdapter(AsyncHTTPRequestAdapter):
106
- def __init__(self, request: HttpRequest) -> None:
107
- self.request = request
108
-
109
- @property
110
- def query_params(self) -> QueryParams:
111
- return self.request.GET.dict()
112
-
113
- @property
114
- def method(self) -> HTTPMethod:
115
- assert self.request.method is not None
116
-
117
- return cast("HTTPMethod", self.request.method.upper())
118
-
119
- @property
120
- def headers(self) -> Mapping[str, str]:
121
- return self.request.headers
122
-
123
- @property
124
- def content_type(self) -> Optional[str]:
125
- return self.headers.get("Content-type")
126
-
127
- async def get_body(self) -> str:
128
- return self.request.body.decode()
129
-
130
- async def get_form_data(self) -> FormData:
131
- return FormData(
132
- files=self.request.FILES,
133
- form=self.request.POST,
134
- )
135
-
136
-
137
68
  class BaseView:
138
69
  graphql_ide_html: str
139
70
 
@@ -13,6 +13,7 @@ from typing import (
13
13
  )
14
14
  from typing_extensions import TypeGuard
15
15
 
16
+ from lia import HTTPException, StarletteRequestAdapter
16
17
  from starlette import status
17
18
  from starlette.background import BackgroundTasks # noqa: TC002
18
19
  from starlette.requests import HTTPConnection, Request
@@ -29,16 +30,19 @@ from fastapi import APIRouter, Depends, params
29
30
  from fastapi.datastructures import Default
30
31
  from fastapi.routing import APIRoute
31
32
  from fastapi.utils import generate_unique_id
32
- from strawberry.asgi import ASGIRequestAdapter, ASGIWebSocketAdapter
33
+ from strawberry.asgi import ASGIWebSocketAdapter
33
34
  from strawberry.exceptions import InvalidCustomContext
34
35
  from strawberry.fastapi.context import BaseContext, CustomContext
35
36
  from strawberry.http.async_base_view import AsyncBaseHTTPView
36
- from strawberry.http.exceptions import HTTPException
37
37
  from strawberry.http.typevars import Context, RootValue
38
38
  from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
39
39
 
40
40
  if TYPE_CHECKING:
41
- from collections.abc import AsyncIterator, Awaitable, Sequence
41
+ from collections.abc import (
42
+ AsyncIterator,
43
+ Awaitable,
44
+ Sequence,
45
+ )
42
46
  from enum import Enum
43
47
 
44
48
  from starlette.routing import BaseRoute
@@ -57,7 +61,7 @@ class GraphQLRouter(
57
61
  APIRouter,
58
62
  ):
59
63
  allow_queries_via_get = True
60
- request_adapter_class = ASGIRequestAdapter
64
+ request_adapter_class = StarletteRequestAdapter
61
65
  websocket_adapter_class = ASGIWebSocketAdapter
62
66
 
63
67
  @staticmethod
@@ -3,67 +3,27 @@ from __future__ import annotations
3
3
  import warnings
4
4
  from typing import (
5
5
  TYPE_CHECKING,
6
- Any,
7
6
  ClassVar,
8
7
  Optional,
9
8
  Union,
10
- cast,
11
9
  )
12
10
  from typing_extensions import TypeGuard
13
11
 
12
+ from lia import AsyncFlaskHTTPRequestAdapter, FlaskHTTPRequestAdapter, HTTPException
13
+
14
14
  from flask import Request, Response, render_template_string, request
15
15
  from flask.views import View
16
- from strawberry.http.async_base_view import AsyncBaseHTTPView, AsyncHTTPRequestAdapter
17
- from strawberry.http.exceptions import HTTPException
18
- from strawberry.http.sync_base_view import (
19
- SyncBaseHTTPView,
20
- SyncHTTPRequestAdapter,
21
- )
22
- from strawberry.http.types import FormData, HTTPMethod, QueryParams
16
+ from strawberry.http.async_base_view import AsyncBaseHTTPView
17
+ from strawberry.http.sync_base_view import SyncBaseHTTPView
23
18
  from strawberry.http.typevars import Context, RootValue
24
19
 
25
20
  if TYPE_CHECKING:
26
- from collections.abc import Mapping
27
-
28
21
  from flask.typing import ResponseReturnValue
29
22
  from strawberry.http import GraphQLHTTPResponse
30
23
  from strawberry.http.ides import GraphQL_IDE
31
24
  from strawberry.schema.base import BaseSchema
32
25
 
33
26
 
34
- class FlaskHTTPRequestAdapter(SyncHTTPRequestAdapter):
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 body(self) -> Union[str, bytes]:
44
- return self.request.data.decode()
45
-
46
- @property
47
- def method(self) -> HTTPMethod:
48
- return cast("HTTPMethod", self.request.method.upper())
49
-
50
- @property
51
- def headers(self) -> Mapping[str, str]:
52
- return self.request.headers # type: ignore
53
-
54
- @property
55
- def post_data(self) -> Mapping[str, Union[str, bytes]]:
56
- return self.request.form
57
-
58
- @property
59
- def files(self) -> Mapping[str, Any]:
60
- return self.request.files
61
-
62
- @property
63
- def content_type(self) -> Optional[str]:
64
- return self.request.content_type
65
-
66
-
67
27
  class BaseGraphQLView:
68
28
  graphql_ide: Optional[GraphQL_IDE]
69
29
 
@@ -131,36 +91,6 @@ class GraphQLView(
131
91
  return render_template_string(self.graphql_ide_html) # type: ignore
132
92
 
133
93
 
134
- class AsyncFlaskHTTPRequestAdapter(AsyncHTTPRequestAdapter):
135
- def __init__(self, request: Request) -> None:
136
- self.request = request
137
-
138
- @property
139
- def query_params(self) -> QueryParams:
140
- return self.request.args.to_dict()
141
-
142
- @property
143
- def method(self) -> HTTPMethod:
144
- return cast("HTTPMethod", self.request.method.upper())
145
-
146
- @property
147
- def content_type(self) -> Optional[str]:
148
- return self.request.content_type
149
-
150
- @property
151
- def headers(self) -> Mapping[str, str]:
152
- return self.request.headers # type: ignore
153
-
154
- async def get_body(self) -> str:
155
- return self.request.data.decode()
156
-
157
- async def get_form_data(self) -> FormData:
158
- return FormData(
159
- files=self.request.files,
160
- form=self.request.form,
161
- )
162
-
163
-
164
94
  class AsyncGraphQLView(
165
95
  BaseGraphQLView,
166
96
  AsyncBaseHTTPView[
@@ -17,6 +17,7 @@ from typing import (
17
17
  from typing_extensions import TypeGuard
18
18
 
19
19
  from graphql import GraphQLError
20
+ from lia import AsyncHTTPRequestAdapter, HTTPException
20
21
 
21
22
  from strawberry.exceptions import MissingQueryError
22
23
  from strawberry.file_uploads.utils import replace_placeholders_with_files
@@ -44,9 +45,7 @@ from strawberry.types.graphql import OperationType
44
45
  from strawberry.types.unset import UNSET, UnsetType
45
46
 
46
47
  from .base import BaseView
47
- from .exceptions import HTTPException
48
48
  from .parse_content_type import parse_content_type
49
- from .types import FormData, HTTPMethod, QueryParams
50
49
  from .typevars import (
51
50
  Context,
52
51
  Request,
@@ -58,30 +57,6 @@ from .typevars import (
58
57
  )
59
58
 
60
59
 
61
- class AsyncHTTPRequestAdapter(abc.ABC):
62
- @property
63
- @abc.abstractmethod
64
- def query_params(self) -> QueryParams: ...
65
-
66
- @property
67
- @abc.abstractmethod
68
- def method(self) -> HTTPMethod: ...
69
-
70
- @property
71
- @abc.abstractmethod
72
- def headers(self) -> Mapping[str, str]: ...
73
-
74
- @property
75
- @abc.abstractmethod
76
- def content_type(self) -> Optional[str]: ...
77
-
78
- @abc.abstractmethod
79
- async def get_body(self) -> Union[str, bytes]: ...
80
-
81
- @abc.abstractmethod
82
- async def get_form_data(self) -> FormData: ...
83
-
84
-
85
60
  class AsyncWebSocketAdapter(abc.ABC):
86
61
  def __init__(self, view: "AsyncBaseHTTPView") -> None:
87
62
  self.view = view
@@ -284,8 +259,9 @@ class AsyncBaseHTTPView(
284
259
  except ValueError as e:
285
260
  raise HTTPException(400, "Unable to parse the multipart body") from e
286
261
 
287
- operations = form_data["form"].get("operations", "{}")
288
- files_map = form_data["form"].get("map", "{}")
262
+ operations = form_data.form.get("operations", "{}")
263
+ files_map = form_data.form.get("map", "{}")
264
+ files = form_data.files
289
265
 
290
266
  if isinstance(operations, (bytes, str)):
291
267
  operations = self.parse_json(operations)
@@ -294,9 +270,7 @@ class AsyncBaseHTTPView(
294
270
  files_map = self.parse_json(files_map)
295
271
 
296
272
  try:
297
- return replace_placeholders_with_files(
298
- operations, files_map, form_data["files"]
299
- )
273
+ return replace_placeholders_with_files(operations, files_map, files)
300
274
  except KeyError as e:
301
275
  raise HTTPException(400, "File(s) missing in form data") from e
302
276
 
@@ -3,12 +3,13 @@ from collections.abc import Mapping
3
3
  from typing import Any, Generic, Optional, Union
4
4
  from typing_extensions import Protocol
5
5
 
6
+ from lia import HTTPException
7
+
6
8
  from strawberry.http import GraphQLRequestData
7
9
  from strawberry.http.ides import GraphQL_IDE, get_graphql_ide_html
8
10
  from strawberry.http.types import HTTPMethod, QueryParams
9
11
  from strawberry.schema.base import BaseSchema
10
12
 
11
- from .exceptions import HTTPException
12
13
  from .typevars import Request
13
14
 
14
15
 
@@ -0,0 +1,17 @@
1
+ class NonTextMessageReceived(Exception):
2
+ pass
3
+
4
+
5
+ class NonJsonMessageReceived(Exception):
6
+ pass
7
+
8
+
9
+ class WebSocketDisconnected(Exception):
10
+ pass
11
+
12
+
13
+ __all__ = [
14
+ "NonJsonMessageReceived",
15
+ "NonTextMessageReceived",
16
+ "WebSocketDisconnected",
17
+ ]