strawberry-graphql 0.279.0.dev1754159379__tar.gz → 0.281.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.

Potentially problematic release.


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

Files changed (251) hide show
  1. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/PKG-INFO +2 -1
  2. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/pyproject.toml +2 -1
  3. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/__init__.py +1 -2
  4. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/aiohttp/views.py +2 -50
  5. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/asgi/__init__.py +2 -39
  6. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/chalice/views.py +7 -75
  7. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/channels/handlers/http_handler.py +30 -6
  8. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/channels/handlers/ws_handler.py +0 -2
  9. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/server.py +1 -11
  10. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/upgrade/__init__.py +2 -0
  11. strawberry_graphql-0.281.0/strawberry/cli/constants.py +1 -0
  12. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/debug_server.py +2 -6
  13. strawberry_graphql-0.281.0/strawberry/codemods/__init__.py +9 -0
  14. strawberry_graphql-0.281.0/strawberry/codemods/maybe_optional.py +118 -0
  15. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/django/views.py +4 -73
  16. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/_compat.py +1 -0
  17. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/error_type.py +1 -0
  18. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/fields.py +1 -0
  19. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/utils.py +1 -0
  20. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/fastapi/router.py +8 -6
  21. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/flask/views.py +4 -74
  22. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/async_base_view.py +5 -34
  23. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/base.py +2 -1
  24. strawberry_graphql-0.281.0/strawberry/http/exceptions.py +17 -0
  25. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/sync_base_view.py +1 -34
  26. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/litestar/controller.py +1 -42
  27. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/quart/views.py +3 -35
  28. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/relay/utils.py +9 -21
  29. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/sanic/views.py +4 -43
  30. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/schema.py +2 -0
  31. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/schema_converter.py +15 -38
  32. strawberry_graphql-0.281.0/strawberry/schema/validation_rules/maybe_null.py +136 -0
  33. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -10
  34. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -6
  35. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/arguments.py +16 -2
  36. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/maybe.py +1 -1
  37. strawberry_graphql-0.279.0.dev1754159379/strawberry/cli/constants.py +0 -2
  38. strawberry_graphql-0.279.0.dev1754159379/strawberry/http/exceptions.py +0 -19
  39. strawberry_graphql-0.279.0.dev1754159379/strawberry/pydantic/__init__.py +0 -22
  40. strawberry_graphql-0.279.0.dev1754159379/strawberry/pydantic/error.py +0 -51
  41. strawberry_graphql-0.279.0.dev1754159379/strawberry/pydantic/fields.py +0 -202
  42. strawberry_graphql-0.279.0.dev1754159379/strawberry/pydantic/object_type.py +0 -348
  43. strawberry_graphql-0.279.0.dev1754159379/strawberry/types/fields/__init__.py +0 -0
  44. strawberry_graphql-0.279.0.dev1754159379/strawberry/utils/debug.py +0 -46
  45. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/LICENSE +0 -0
  46. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/README.md +0 -0
  47. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/__main__.py +0 -0
  48. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/aiohttp/__init__.py +0 -0
  49. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/aiohttp/test/__init__.py +0 -0
  50. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/aiohttp/test/client.py +0 -0
  51. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/annotation.py +0 -0
  52. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/asgi/test/__init__.py +0 -0
  53. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/asgi/test/client.py +0 -0
  54. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/chalice/__init__.py +0 -0
  55. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/channels/__init__.py +0 -0
  56. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/channels/handlers/__init__.py +0 -0
  57. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/channels/handlers/base.py +0 -0
  58. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/channels/router.py +0 -0
  59. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/channels/testing.py +0 -0
  60. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/__init__.py +0 -0
  61. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/app.py +0 -0
  62. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/__init__.py +0 -0
  63. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/codegen.py +0 -0
  64. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/export_schema.py +0 -0
  65. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/locate_definition.py +0 -0
  66. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/schema_codegen.py +0 -0
  67. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
  68. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
  69. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/utils/__init__.py +0 -0
  70. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/cli/utils/load_schema.py +0 -0
  71. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codegen/__init__.py +0 -0
  72. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codegen/exceptions.py +0 -0
  73. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codegen/plugins/__init__.py +0 -0
  74. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codegen/plugins/print_operation.py +0 -0
  75. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codegen/plugins/python.py +0 -0
  76. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codegen/plugins/typescript.py +0 -0
  77. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codegen/query_codegen.py +0 -0
  78. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codegen/types.py +0 -0
  79. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codemods/annotated_unions.py +0 -0
  80. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/codemods/update_imports.py +0 -0
  81. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/dataloader.py +0 -0
  82. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/directive.py +0 -0
  83. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/django/__init__.py +0 -0
  84. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/django/apps.py +0 -0
  85. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/django/context.py +0 -0
  86. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/django/test/__init__.py +0 -0
  87. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/django/test/client.py +0 -0
  88. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/__init__.py +0 -0
  89. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/conflicting_arguments.py +0 -0
  90. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/duplicated_type_name.py +0 -0
  91. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/exception.py +0 -0
  92. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/exception_source.py +0 -0
  93. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/handler.py +0 -0
  94. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/invalid_argument_type.py +0 -0
  95. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/invalid_superclass_interface.py +0 -0
  96. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/invalid_union_type.py +0 -0
  97. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
  98. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/missing_dependencies.py +0 -0
  99. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/missing_field_annotation.py +0 -0
  100. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/missing_return_annotation.py +0 -0
  101. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/object_is_not_a_class.py +0 -0
  102. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
  103. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
  104. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/private_strawberry_field.py +0 -0
  105. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/scalar_already_registered.py +0 -0
  106. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/syntax.py +0 -0
  107. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/unresolved_field_type.py +0 -0
  108. {strawberry_graphql-0.279.0.dev1754159379/strawberry/codemods → strawberry_graphql-0.281.0/strawberry/exceptions/utils}/__init__.py +0 -0
  109. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/exceptions/utils/source_finder.py +0 -0
  110. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/__init__.py +0 -0
  111. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/__init__.py +0 -0
  112. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/conversion.py +0 -0
  113. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/conversion_types.py +0 -0
  114. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/exceptions.py +0 -0
  115. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/experimental/pydantic/object_type.py +0 -0
  116. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/ext/LICENSE +0 -0
  117. {strawberry_graphql-0.279.0.dev1754159379/strawberry/exceptions/utils → strawberry_graphql-0.281.0/strawberry/ext}/__init__.py +0 -0
  118. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/ext/dataclasses/LICENSE +0 -0
  119. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/ext/dataclasses/README.md +0 -0
  120. {strawberry_graphql-0.279.0.dev1754159379/strawberry/ext → strawberry_graphql-0.281.0/strawberry/ext/dataclasses}/__init__.py +0 -0
  121. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/ext/dataclasses/dataclasses.py +0 -0
  122. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/ext/mypy_plugin.py +0 -0
  123. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/__init__.py +0 -0
  124. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/add_validation_rules.py +0 -0
  125. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/base_extension.py +0 -0
  126. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/context.py +0 -0
  127. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/directives.py +0 -0
  128. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/disable_introspection.py +0 -0
  129. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/disable_validation.py +0 -0
  130. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/field_extension.py +0 -0
  131. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/mask_errors.py +0 -0
  132. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/max_aliases.py +0 -0
  133. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/max_tokens.py +0 -0
  134. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/parser_cache.py +0 -0
  135. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/pyinstrument.py +0 -0
  136. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/query_depth_limiter.py +0 -0
  137. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/runner.py +0 -0
  138. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/tracing/__init__.py +0 -0
  139. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/tracing/apollo.py +0 -0
  140. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/tracing/datadog.py +0 -0
  141. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/tracing/opentelemetry.py +0 -0
  142. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/tracing/utils.py +0 -0
  143. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/utils.py +0 -0
  144. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/extensions/validation_cache.py +0 -0
  145. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/fastapi/__init__.py +0 -0
  146. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/fastapi/context.py +0 -0
  147. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/__init__.py +0 -0
  148. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/argument.py +0 -0
  149. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/enum.py +0 -0
  150. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/field.py +0 -0
  151. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/mutation.py +0 -0
  152. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/object_type.py +0 -0
  153. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/scalar.py +0 -0
  154. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/schema.py +0 -0
  155. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/schema_directive.py +0 -0
  156. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/schema_directives.py +0 -0
  157. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/types.py +0 -0
  158. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/federation/union.py +0 -0
  159. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/field_extensions/__init__.py +0 -0
  160. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/field_extensions/input_mutation.py +0 -0
  161. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/file_uploads/__init__.py +0 -0
  162. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/file_uploads/scalars.py +0 -0
  163. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/file_uploads/utils.py +0 -0
  164. {strawberry_graphql-0.279.0.dev1754159379/strawberry/ext/dataclasses → strawberry_graphql-0.281.0/strawberry/flask}/__init__.py +0 -0
  165. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/__init__.py +0 -0
  166. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/ides.py +0 -0
  167. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/parse_content_type.py +0 -0
  168. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/temporal_response.py +0 -0
  169. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/types.py +0 -0
  170. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/http/typevars.py +0 -0
  171. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/litestar/__init__.py +0 -0
  172. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/parent.py +0 -0
  173. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/permission.py +0 -0
  174. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/printer/__init__.py +0 -0
  175. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/printer/ast_from_value.py +0 -0
  176. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/printer/printer.py +0 -0
  177. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/py.typed +0 -0
  178. {strawberry_graphql-0.279.0.dev1754159379/strawberry/flask → strawberry_graphql-0.281.0/strawberry/quart}/__init__.py +0 -0
  179. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/relay/__init__.py +0 -0
  180. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/relay/exceptions.py +0 -0
  181. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/relay/fields.py +0 -0
  182. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/relay/types.py +0 -0
  183. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/resolvers.py +0 -0
  184. {strawberry_graphql-0.279.0.dev1754159379/strawberry/quart → strawberry_graphql-0.281.0/strawberry/sanic}/__init__.py +0 -0
  185. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/sanic/context.py +0 -0
  186. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/sanic/utils.py +0 -0
  187. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/scalars.py +0 -0
  188. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/__init__.py +0 -0
  189. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/_graphql_core.py +0 -0
  190. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/base.py +0 -0
  191. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/compat.py +0 -0
  192. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/config.py +0 -0
  193. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/exceptions.py +0 -0
  194. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/name_converter.py +0 -0
  195. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/types/__init__.py +0 -0
  196. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/types/base_scalars.py +0 -0
  197. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/types/concrete_type.py +0 -0
  198. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/types/scalar.py +0 -0
  199. {strawberry_graphql-0.279.0.dev1754159379/strawberry/sanic → strawberry_graphql-0.281.0/strawberry/schema/validation_rules}/__init__.py +0 -0
  200. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema/validation_rules/one_of.py +0 -0
  201. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema_codegen/__init__.py +0 -0
  202. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema_directive.py +0 -0
  203. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/schema_directives.py +0 -0
  204. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/static/apollo-sandbox.html +0 -0
  205. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/static/graphiql.html +0 -0
  206. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/static/pathfinder.html +0 -0
  207. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/streamable.py +0 -0
  208. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/subscriptions/__init__.py +0 -0
  209. {strawberry_graphql-0.279.0.dev1754159379/strawberry/schema/validation_rules → strawberry_graphql-0.281.0/strawberry/subscriptions/protocols}/__init__.py +0 -0
  210. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
  211. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
  212. {strawberry_graphql-0.279.0.dev1754159379/strawberry/subscriptions/protocols → strawberry_graphql-0.281.0/strawberry/subscriptions/protocols/graphql_ws}/__init__.py +0 -0
  213. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
  214. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/test/__init__.py +0 -0
  215. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/test/client.py +0 -0
  216. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/tools/__init__.py +0 -0
  217. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/tools/create_type.py +0 -0
  218. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/tools/merge_types.py +0 -0
  219. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/__init__.py +0 -0
  220. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/auto.py +0 -0
  221. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/base.py +0 -0
  222. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/cast.py +0 -0
  223. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/enum.py +0 -0
  224. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/execution.py +0 -0
  225. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/field.py +0 -0
  226. {strawberry_graphql-0.279.0.dev1754159379/strawberry/subscriptions/protocols/graphql_ws → strawberry_graphql-0.281.0/strawberry/types/fields}/__init__.py +0 -0
  227. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/fields/resolver.py +0 -0
  228. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/graphql.py +0 -0
  229. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/info.py +0 -0
  230. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/lazy_type.py +0 -0
  231. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/mutation.py +0 -0
  232. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/nodes.py +0 -0
  233. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/object_type.py +0 -0
  234. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/private.py +0 -0
  235. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/scalar.py +0 -0
  236. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/type_resolver.py +0 -0
  237. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/union.py +0 -0
  238. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/types/unset.py +0 -0
  239. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/__init__.py +0 -0
  240. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/aio.py +0 -0
  241. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/await_maybe.py +0 -0
  242. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/dataclasses.py +0 -0
  243. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/deprecations.py +0 -0
  244. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/graphql_lexer.py +0 -0
  245. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/importer.py +0 -0
  246. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/inspect.py +0 -0
  247. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/locate_definition.py +0 -0
  248. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/logging.py +0 -0
  249. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/operation.py +0 -0
  250. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/str_converters.py +0 -0
  251. {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.281.0}/strawberry/utils/typing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.279.0.dev1754159379
3
+ Version: 0.281.0
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -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.279.0.dev.1754159379"
3
+ version = "0.281.0"
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]
@@ -4,7 +4,7 @@ Strawberry is a Python library for GraphQL that aims to stay close to the GraphQ
4
4
  specification and allow for a more natural way of defining GraphQL schemas.
5
5
  """
6
6
 
7
- from . import experimental, federation, pydantic, relay
7
+ from . import experimental, federation, relay
8
8
  from .directive import directive, directive_field
9
9
  from .parent import Parent
10
10
  from .permission import BasePermission
@@ -54,7 +54,6 @@ __all__ = [
54
54
  "interface",
55
55
  "lazy",
56
56
  "mutation",
57
- "pydantic",
58
57
  "relay",
59
58
  "scalar",
60
59
  "schema_directive",
@@ -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
@@ -143,7 +97,6 @@ class GraphQLView(
143
97
  allow_queries_via_get: bool = True,
144
98
  keep_alive: bool = True,
145
99
  keep_alive_interval: float = 1,
146
- debug: bool = False,
147
100
  subscription_protocols: Sequence[str] = (
148
101
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
149
102
  GRAPHQL_WS_PROTOCOL,
@@ -155,7 +108,6 @@ class GraphQLView(
155
108
  self.allow_queries_via_get = allow_queries_via_get
156
109
  self.keep_alive = keep_alive
157
110
  self.keep_alive_interval = keep_alive_interval
158
- self.debug = debug
159
111
  self.subscription_protocols = subscription_protocols
160
112
  self.connection_init_wait_timeout = connection_init_wait_timeout
161
113
  self.multipart_uploads_enabled = multipart_uploads_enabled
@@ -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__(
@@ -138,7 +103,6 @@ class GraphQL(
138
103
  allow_queries_via_get: bool = True,
139
104
  keep_alive: bool = False,
140
105
  keep_alive_interval: float = 1,
141
- debug: bool = False,
142
106
  subscription_protocols: Sequence[str] = (
143
107
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
144
108
  GRAPHQL_WS_PROTOCOL,
@@ -150,7 +114,6 @@ class GraphQL(
150
114
  self.allow_queries_via_get = allow_queries_via_get
151
115
  self.keep_alive = keep_alive
152
116
  self.keep_alive_interval = keep_alive_interval
153
- self.debug = debug
154
117
  self.protocols = subscription_protocols
155
118
  self.connection_init_wait_timeout = connection_init_wait_timeout
156
119
  self.multipart_uploads_enabled = multipart_uploads_enabled
@@ -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
  ):
@@ -88,28 +53,6 @@ class GraphQLView(
88
53
  def get_sub_response(self, request: Request) -> TemporalResponse:
89
54
  return TemporalResponse()
90
55
 
91
- @staticmethod
92
- def error_response(
93
- message: str,
94
- error_code: str,
95
- http_status_code: int,
96
- headers: Optional[dict[str, str | list[str]]] = None,
97
- ) -> Response:
98
- """A wrapper for error responses.
99
-
100
- Args:
101
- message: The error message.
102
- error_code: The error code.
103
- http_status_code: The HTTP status code.
104
- headers: The headers to include in the response.
105
-
106
- Returns:
107
- An errors response.
108
- """
109
- body = {"Code": error_code, "Message": message}
110
-
111
- return Response(body=body, status_code=http_status_code, headers=headers)
112
-
113
56
  def get_context(self, request: Request, response: TemporalResponse) -> Context:
114
57
  return {"request": request, "response": response} # type: ignore
115
58
 
@@ -136,20 +79,9 @@ class GraphQLView(
136
79
  try:
137
80
  return self.run(request=request)
138
81
  except HTTPException as e:
139
- error_code_map = {
140
- 400: "BadRequestError",
141
- 401: "UnauthorizedError",
142
- 403: "ForbiddenError",
143
- 404: "NotFoundError",
144
- 409: "ConflictError",
145
- 429: "TooManyRequestsError",
146
- 500: "ChaliceViewError",
147
- }
148
-
149
- return self.error_response(
150
- error_code=error_code_map.get(e.status_code, "ChaliceViewError"),
151
- message=e.reason,
152
- http_status_code=e.status_code,
82
+ return Response(
83
+ body=e.reason,
84
+ status_code=e.status_code,
153
85
  )
154
86
 
155
87
 
@@ -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):
@@ -109,7 +109,6 @@ class GraphQLWSConsumer(
109
109
  schema: BaseSchema,
110
110
  keep_alive: bool = False,
111
111
  keep_alive_interval: float = 1,
112
- debug: bool = False,
113
112
  subscription_protocols: Sequence[str] = (
114
113
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
115
114
  GRAPHQL_WS_PROTOCOL,
@@ -122,7 +121,6 @@ class GraphQLWSConsumer(
122
121
  self.schema = schema
123
122
  self.keep_alive = keep_alive
124
123
  self.keep_alive_interval = keep_alive_interval
125
- self.debug = debug
126
124
  self.protocols = subscription_protocols
127
125
  self.message_queue: asyncio.Queue[MessageQueueData] = asyncio.Queue()
128
126
  self.run_task: Optional[asyncio.Task] = None
@@ -6,10 +6,7 @@ import rich
6
6
  import typer
7
7
 
8
8
  from strawberry.cli.app import app
9
- from strawberry.cli.constants import (
10
- DEBUG_SERVER_LOG_OPERATIONS,
11
- DEBUG_SERVER_SCHEMA_ENV_VAR_KEY,
12
- )
9
+ from strawberry.cli.constants import DEBUG_SERVER_SCHEMA_ENV_VAR_KEY
13
10
  from strawberry.cli.utils import load_schema
14
11
 
15
12
 
@@ -42,12 +39,6 @@ def server(
42
39
  "Works the same as `--app-dir` in uvicorn."
43
40
  ),
44
41
  ),
45
- log_operations: bool = typer.Option(
46
- True,
47
- "--log-operations",
48
- show_default=True,
49
- help="Log GraphQL operations",
50
- ),
51
42
  ) -> None:
52
43
  sys.path.insert(0, app_dir)
53
44
 
@@ -65,7 +56,6 @@ def server(
65
56
  load_schema(schema, app_dir=app_dir)
66
57
 
67
58
  os.environ[DEBUG_SERVER_SCHEMA_ENV_VAR_KEY] = schema
68
- os.environ[DEBUG_SERVER_LOG_OPERATIONS] = str(log_operations)
69
59
  app = "strawberry.cli.debug_server:app"
70
60
 
71
61
  # Windows doesn't support UTF-8 by default
@@ -10,6 +10,7 @@ from libcst.codemod import CodemodContext
10
10
 
11
11
  from strawberry.cli.app import app
12
12
  from strawberry.codemods.annotated_unions import ConvertUnionToAnnotatedUnion
13
+ from strawberry.codemods.maybe_optional import ConvertMaybeToOptional
13
14
  from strawberry.codemods.update_imports import UpdateImportsCodemod
14
15
 
15
16
  from ._run_codemod import run_codemod
@@ -17,6 +18,7 @@ from ._run_codemod import run_codemod
17
18
  codemods = {
18
19
  "annotated-union": ConvertUnionToAnnotatedUnion,
19
20
  "update-imports": UpdateImportsCodemod,
21
+ "maybe-optional": ConvertMaybeToOptional,
20
22
  }
21
23
 
22
24
 
@@ -0,0 +1 @@
1
+ DEBUG_SERVER_SCHEMA_ENV_VAR_KEY = "STRAWBERRY_DEBUG_SERVER_SCHEMA"
@@ -6,10 +6,7 @@ from starlette.middleware.cors import CORSMiddleware
6
6
 
7
7
  from strawberry import Schema
8
8
  from strawberry.asgi import GraphQL
9
- from strawberry.cli.constants import (
10
- DEBUG_SERVER_LOG_OPERATIONS,
11
- DEBUG_SERVER_SCHEMA_ENV_VAR_KEY,
12
- )
9
+ from strawberry.cli.constants import DEBUG_SERVER_SCHEMA_ENV_VAR_KEY
13
10
  from strawberry.utils.importer import import_module_symbol
14
11
 
15
12
  app = Starlette(debug=True)
@@ -19,10 +16,9 @@ app.add_middleware(
19
16
 
20
17
  schema_import_string = os.environ[DEBUG_SERVER_SCHEMA_ENV_VAR_KEY]
21
18
  schema_symbol = import_module_symbol(schema_import_string, default_symbol_name="schema")
22
- log_operations = os.environ[DEBUG_SERVER_LOG_OPERATIONS] == "True"
23
19
 
24
20
  assert isinstance(schema_symbol, Schema)
25
- graphql_app = GraphQL[Any, Any](schema_symbol, debug=log_operations)
21
+ graphql_app = GraphQL[Any, Any](schema_symbol)
26
22
 
27
23
  paths = ["/", "/graphql"]
28
24
  for path in paths:
@@ -0,0 +1,9 @@
1
+ from .annotated_unions import ConvertUnionToAnnotatedUnion
2
+ from .maybe_optional import ConvertMaybeToOptional
3
+ from .update_imports import UpdateImportsCodemod
4
+
5
+ __all__ = [
6
+ "ConvertMaybeToOptional",
7
+ "ConvertUnionToAnnotatedUnion",
8
+ "UpdateImportsCodemod",
9
+ ]
@@ -0,0 +1,118 @@
1
+ from __future__ import annotations
2
+
3
+ import libcst as cst
4
+ import libcst.matchers as m
5
+ from libcst._nodes.expression import BaseExpression # noqa: TC002
6
+ from libcst.codemod import CodemodContext, VisitorBasedCodemodCommand
7
+ from libcst.codemod.visitors import AddImportsVisitor
8
+
9
+
10
+ class ConvertMaybeToOptional(VisitorBasedCodemodCommand):
11
+ DESCRIPTION: str = (
12
+ "Converts strawberry.Maybe[T] to strawberry.Maybe[T | None] "
13
+ "to match the new Maybe type definition"
14
+ )
15
+
16
+ def __init__(
17
+ self,
18
+ context: CodemodContext,
19
+ use_pipe_syntax: bool = True, # Default to pipe syntax for modern Python
20
+ ) -> None:
21
+ self.use_pipe_syntax = use_pipe_syntax
22
+ super().__init__(context)
23
+
24
+ @m.leave(
25
+ m.Subscript(
26
+ value=m.Attribute(value=m.Name("strawberry"), attr=m.Name("Maybe"))
27
+ | m.Name("Maybe")
28
+ )
29
+ )
30
+ def leave_maybe_subscript(
31
+ self, original_node: cst.Subscript, updated_node: cst.Subscript
32
+ ) -> BaseExpression:
33
+ # Skip if it's not a strawberry.Maybe or imported Maybe
34
+ if isinstance(original_node.value, cst.Name):
35
+ # Check if this is an imported Maybe from strawberry
36
+ # For now, we'll assume any standalone "Maybe" is from strawberry
37
+ # In a more robust implementation, we'd track imports
38
+ pass
39
+
40
+ # Get the inner type
41
+ if isinstance(original_node.slice, (list, tuple)):
42
+ if len(original_node.slice) != 1:
43
+ return original_node
44
+ slice_element = original_node.slice[0]
45
+ else:
46
+ slice_element = original_node.slice
47
+
48
+ if not isinstance(slice_element, cst.SubscriptElement):
49
+ return original_node
50
+
51
+ if not isinstance(slice_element.slice, cst.Index):
52
+ return original_node
53
+
54
+ inner_type = slice_element.slice.value
55
+
56
+ # Check if the inner type already includes None
57
+ if self._already_includes_none(inner_type):
58
+ return original_node
59
+
60
+ # Create the new union type with None
61
+ new_type: BaseExpression
62
+ if self.use_pipe_syntax:
63
+ new_type = cst.BinaryOperation(
64
+ left=inner_type,
65
+ operator=cst.BitOr(
66
+ whitespace_before=cst.SimpleWhitespace(" "),
67
+ whitespace_after=cst.SimpleWhitespace(" "),
68
+ ),
69
+ right=cst.Name("None"),
70
+ )
71
+ else:
72
+ # Use Union[T, None] syntax
73
+ AddImportsVisitor.add_needed_import(self.context, "typing", "Union")
74
+ new_type = cst.Subscript(
75
+ value=cst.Name("Union"),
76
+ slice=[
77
+ cst.SubscriptElement(slice=cst.Index(value=inner_type)),
78
+ cst.SubscriptElement(slice=cst.Index(value=cst.Name("None"))),
79
+ ],
80
+ )
81
+
82
+ # Return the updated Maybe[T | None]
83
+ return updated_node.with_changes(
84
+ slice=[cst.SubscriptElement(slice=cst.Index(value=new_type))]
85
+ )
86
+
87
+ def _already_includes_none(self, node: BaseExpression) -> bool:
88
+ """Check if the type already includes None (e.g., T | None or Union[T, None])."""
89
+ # Check for T | None pattern
90
+ if isinstance(node, cst.BinaryOperation) and isinstance(
91
+ node.operator, cst.BitOr
92
+ ):
93
+ if isinstance(node.right, cst.Name) and node.right.value == "None":
94
+ return True
95
+ # Recursively check left side for chained unions
96
+ if self._already_includes_none(node.left):
97
+ return True
98
+
99
+ # Check for Union[..., None] pattern
100
+ if (
101
+ isinstance(node, cst.Subscript)
102
+ and isinstance(node.value, cst.Name)
103
+ and node.value.value == "Union"
104
+ ):
105
+ # Handle both list and tuple slice formats
106
+ slice_elements = (
107
+ node.slice if isinstance(node.slice, (list, tuple)) else [node.slice]
108
+ )
109
+ for element in slice_elements:
110
+ if (
111
+ isinstance(element, cst.SubscriptElement)
112
+ and isinstance(element.slice, cst.Index)
113
+ and isinstance(element.slice.value, cst.Name)
114
+ and element.slice.value.value == "None"
115
+ ):
116
+ return True
117
+
118
+ return False