strawberry-graphql 0.254.1__tar.gz → 0.256.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/PKG-INFO +3 -6
  2. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/pyproject.toml +5 -10
  3. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/__init__.py +9 -9
  4. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/aiohttp/test/client.py +10 -8
  5. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/aiohttp/views.py +5 -7
  6. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/annotation.py +13 -16
  7. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/asgi/__init__.py +3 -6
  8. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/asgi/test/client.py +9 -8
  9. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/chalice/views.py +4 -2
  10. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/channels/handlers/base.py +3 -7
  11. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/channels/handlers/http_handler.py +5 -6
  12. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/channels/handlers/ws_handler.py +3 -4
  13. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/channels/testing.py +5 -9
  14. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/commands/codegen.py +9 -9
  15. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/commands/upgrade/__init__.py +2 -3
  16. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/commands/upgrade/_run_codemod.py +7 -5
  17. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codegen/plugins/print_operation.py +6 -6
  18. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codegen/plugins/python.py +6 -6
  19. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codegen/plugins/typescript.py +3 -3
  20. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codegen/query_codegen.py +29 -34
  21. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codegen/types.py +35 -34
  22. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codemods/annotated_unions.py +5 -2
  23. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/dataloader.py +13 -20
  24. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/directive.py +12 -5
  25. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/django/test/client.py +4 -4
  26. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/django/views.py +4 -5
  27. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/__init__.py +24 -24
  28. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/conflicting_arguments.py +2 -2
  29. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/duplicated_type_name.py +3 -3
  30. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/handler.py +7 -7
  31. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/invalid_union_type.py +2 -2
  32. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/missing_arguments_annotations.py +2 -2
  33. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/missing_field_annotation.py +2 -2
  34. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/object_is_not_an_enum.py +2 -2
  35. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/private_strawberry_field.py +2 -2
  36. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/syntax.py +4 -4
  37. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/utils/source_finder.py +7 -6
  38. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/__init__.py +3 -3
  39. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/_compat.py +14 -14
  40. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/conversion.py +2 -2
  41. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/conversion_types.py +3 -3
  42. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/error_type.py +18 -16
  43. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/exceptions.py +5 -5
  44. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/fields.py +2 -13
  45. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/object_type.py +20 -22
  46. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/pydantic/utils.py +6 -10
  47. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/ext/dataclasses/dataclasses.py +3 -3
  48. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/ext/mypy_plugin.py +6 -9
  49. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/__init__.py +7 -8
  50. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/add_validation_rules.py +5 -3
  51. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/base_extension.py +4 -4
  52. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/context.py +15 -14
  53. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/directives.py +2 -2
  54. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/disable_validation.py +1 -1
  55. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/field_extension.py +2 -1
  56. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/mask_errors.py +3 -2
  57. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/max_aliases.py +2 -2
  58. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/max_tokens.py +1 -1
  59. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/parser_cache.py +2 -1
  60. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/pyinstrument.py +4 -1
  61. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/query_depth_limiter.py +13 -13
  62. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/runner.py +7 -7
  63. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/tracing/apollo.py +11 -9
  64. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/tracing/datadog.py +3 -1
  65. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/tracing/opentelemetry.py +7 -10
  66. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/utils.py +3 -3
  67. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/validation_cache.py +2 -1
  68. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/fastapi/context.py +3 -3
  69. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/fastapi/router.py +9 -14
  70. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/__init__.py +4 -4
  71. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/argument.py +2 -1
  72. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/enum.py +8 -8
  73. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/field.py +25 -28
  74. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/object_type.py +24 -26
  75. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/scalar.py +7 -8
  76. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/schema.py +30 -36
  77. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/schema_directive.py +5 -5
  78. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/schema_directives.py +14 -14
  79. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/union.py +3 -2
  80. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/field_extensions/input_mutation.py +1 -2
  81. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/file_uploads/utils.py +4 -3
  82. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/flask/views.py +3 -2
  83. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/__init__.py +6 -6
  84. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/async_base_view.py +9 -14
  85. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/base.py +5 -4
  86. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/ides.py +1 -1
  87. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/parse_content_type.py +1 -2
  88. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/sync_base_view.py +3 -5
  89. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/temporal_response.py +1 -2
  90. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/types.py +3 -2
  91. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/litestar/controller.py +8 -14
  92. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/parent.py +1 -2
  93. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/permission.py +6 -8
  94. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/printer/ast_from_value.py +2 -1
  95. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/printer/printer.py +50 -30
  96. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/quart/views.py +3 -3
  97. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/relay/exceptions.py +4 -4
  98. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/relay/fields.py +43 -63
  99. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/relay/types.py +29 -27
  100. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/relay/utils.py +4 -4
  101. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/sanic/utils.py +4 -4
  102. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/sanic/views.py +5 -7
  103. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/scalars.py +2 -2
  104. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/base.py +16 -11
  105. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/compat.py +4 -4
  106. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/execute.py +6 -10
  107. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/name_converter.py +3 -3
  108. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/schema.py +37 -25
  109. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/schema_converter.py +22 -24
  110. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/subscribe.py +5 -4
  111. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/types/base_scalars.py +1 -1
  112. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/types/concrete_type.py +2 -2
  113. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/types/scalar.py +3 -4
  114. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema_codegen/__init__.py +4 -4
  115. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema_directive.py +8 -8
  116. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +8 -9
  117. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +16 -16
  118. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +6 -5
  119. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/subscriptions/protocols/graphql_ws/types.py +13 -13
  120. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/test/__init__.py +1 -1
  121. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/test/client.py +21 -19
  122. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/tools/create_type.py +4 -3
  123. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/tools/merge_types.py +1 -2
  124. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/arguments.py +10 -12
  125. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/auto.py +2 -2
  126. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/base.py +17 -21
  127. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/enum.py +3 -5
  128. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/execution.py +8 -12
  129. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/field.py +26 -31
  130. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/fields/resolver.py +15 -17
  131. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/graphql.py +2 -2
  132. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/info.py +5 -9
  133. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/lazy_type.py +3 -5
  134. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/mutation.py +25 -28
  135. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/nodes.py +11 -9
  136. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/object_type.py +14 -16
  137. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/private.py +1 -2
  138. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/scalar.py +2 -2
  139. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/type_resolver.py +5 -5
  140. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/union.py +8 -11
  141. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/unset.py +3 -3
  142. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/aio.py +3 -8
  143. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/await_maybe.py +3 -2
  144. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/debug.py +2 -2
  145. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/deprecations.py +2 -2
  146. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/inspect.py +3 -5
  147. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/str_converters.py +1 -1
  148. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/typing.py +38 -67
  149. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/LICENSE +0 -0
  150. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/README.md +0 -0
  151. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/__main__.py +0 -0
  152. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/aiohttp/__init__.py +0 -0
  153. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/aiohttp/test/__init__.py +0 -0
  154. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/asgi/test/__init__.py +0 -0
  155. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/chalice/__init__.py +0 -0
  156. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/channels/__init__.py +1 -1
  157. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/channels/handlers/__init__.py +0 -0
  158. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/channels/router.py +0 -0
  159. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/__init__.py +0 -0
  160. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/app.py +0 -0
  161. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/commands/__init__.py +0 -0
  162. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/commands/export_schema.py +0 -0
  163. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/commands/schema_codegen.py +0 -0
  164. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/commands/server.py +0 -0
  165. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
  166. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/constants.py +0 -0
  167. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/debug_server.py +0 -0
  168. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/utils/__init__.py +0 -0
  169. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/cli/utils/load_schema.py +0 -0
  170. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codegen/__init__.py +0 -0
  171. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codegen/exceptions.py +2 -2
  172. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codegen/plugins/__init__.py +0 -0
  173. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codemods/__init__.py +0 -0
  174. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/codemods/update_imports.py +0 -0
  175. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/django/__init__.py +0 -0
  176. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/django/apps.py +0 -0
  177. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/django/context.py +0 -0
  178. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/django/test/__init__.py +0 -0
  179. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/exception.py +0 -0
  180. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/exception_source.py +0 -0
  181. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/invalid_argument_type.py +0 -0
  182. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/missing_dependencies.py +0 -0
  183. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/missing_return_annotation.py +0 -0
  184. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/object_is_not_a_class.py +0 -0
  185. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
  186. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/scalar_already_registered.py +0 -0
  187. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/unresolved_field_type.py +0 -0
  188. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/exceptions/utils/__init__.py +0 -0
  189. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/experimental/__init__.py +0 -0
  190. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/ext/LICENSE +0 -0
  191. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/ext/__init__.py +0 -0
  192. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/ext/dataclasses/LICENSE +0 -0
  193. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/ext/dataclasses/__init__.py +0 -0
  194. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/tracing/__init__.py +0 -0
  195. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/extensions/tracing/utils.py +0 -0
  196. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/fastapi/__init__.py +0 -0
  197. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/mutation.py +0 -0
  198. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/federation/types.py +0 -0
  199. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/field_extensions/__init__.py +0 -0
  200. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/file_uploads/__init__.py +0 -0
  201. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/file_uploads/scalars.py +0 -0
  202. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/flask/__init__.py +0 -0
  203. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/exceptions.py +0 -0
  204. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/http/typevars.py +0 -0
  205. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/litestar/__init__.py +0 -0
  206. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/printer/__init__.py +0 -0
  207. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/py.typed +0 -0
  208. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/quart/__init__.py +0 -0
  209. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/relay/__init__.py +0 -0
  210. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/resolvers.py +0 -0
  211. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/sanic/__init__.py +0 -0
  212. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/sanic/context.py +0 -0
  213. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/__init__.py +0 -0
  214. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/config.py +0 -0
  215. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/exceptions.py +0 -0
  216. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/types/__init__.py +0 -0
  217. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/validation_rules/__init__.py +0 -0
  218. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema/validation_rules/one_of.py +0 -0
  219. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/schema_directives.py +0 -0
  220. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/static/apollo-sandbox.html +0 -0
  221. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/static/graphiql.html +0 -0
  222. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/static/pathfinder.html +0 -0
  223. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/subscriptions/__init__.py +0 -0
  224. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/subscriptions/protocols/__init__.py +0 -0
  225. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
  226. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
  227. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/tools/__init__.py +0 -0
  228. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/__init__.py +1 -1
  229. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/types/fields/__init__.py +0 -0
  230. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/__init__.py +0 -0
  231. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/dataclasses.py +0 -0
  232. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/graphql_lexer.py +0 -0
  233. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/importer.py +0 -0
  234. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/logging.py +0 -0
  235. {strawberry_graphql-0.254.1 → strawberry_graphql-0.256.0}/strawberry/utils/operation.py +0 -0
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.254.1
3
+ Version: 0.256.0
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
7
7
  Keywords: graphql,api,rest,starlette,async
8
8
  Author: Patrick Arminio
9
9
  Author-email: patrick.arminio@gmail.com
10
- Requires-Python: >=3.8,<4.0
10
+ Requires-Python: >=3.9,<4.0
11
11
  Classifier: Development Status :: 5 - Production/Stable
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
@@ -39,15 +38,13 @@ Provides-Extra: sanic
39
38
  Requires-Dist: Django (>=3.2) ; extra == "django"
40
39
  Requires-Dist: aiohttp (>=3.7.4.post0,<4.0.0) ; extra == "aiohttp"
41
40
  Requires-Dist: asgiref (>=3.2,<4.0) ; extra == "django" or extra == "channels"
42
- Requires-Dist: astunparse (>=1.6.3,<2.0.0) ; python_version < "3.9"
43
41
  Requires-Dist: chalice (>=1.22,<2.0) ; extra == "chalice"
44
42
  Requires-Dist: channels (>=3.0.5) ; extra == "channels"
45
43
  Requires-Dist: fastapi (>=0.65.2) ; extra == "fastapi"
46
44
  Requires-Dist: flask (>=1.1) ; extra == "flask"
47
- Requires-Dist: graphlib_backport ; (python_version < "3.9") and (extra == "cli")
48
45
  Requires-Dist: graphql-core (>=3.2.0,<3.4.0)
49
46
  Requires-Dist: libcst (>=0.4.7) ; extra == "debug" or extra == "debug-server" or extra == "cli"
50
- Requires-Dist: litestar (>=2) ; (python_version >= "3.8") and (extra == "litestar")
47
+ Requires-Dist: litestar (>=2) ; extra == "litestar"
51
48
  Requires-Dist: opentelemetry-api (<2) ; extra == "opentelemetry"
52
49
  Requires-Dist: opentelemetry-sdk (<2) ; extra == "opentelemetry"
53
50
  Requires-Dist: pydantic (>1.6.1) ; extra == "pydantic"
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "strawberry-graphql"
3
3
  packages = [ { include = "strawberry" } ]
4
- version = "0.254.1"
4
+ version = "0.256.0"
5
5
  description = "A library for creating GraphQL APIs"
6
6
  authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
7
7
  license = "MIT"
@@ -34,7 +34,7 @@ requires = ["poetry-core>=1.6"]
34
34
  build-backend = "poetry.core.masonry.api"
35
35
 
36
36
  [tool.poetry.dependencies]
37
- python = "^3.8"
37
+ python = "^3.9"
38
38
  graphql-core = ">=3.2.0,<3.4.0"
39
39
  typing-extensions = ">=4.5.0"
40
40
  python-dateutil = "^2.7.0"
@@ -54,13 +54,11 @@ python-multipart = {version = ">=0.0.7", optional = true}
54
54
  sanic = {version = ">=20.12.2", optional = true}
55
55
  aiohttp = {version = "^3.7.4.post0", optional = true}
56
56
  fastapi = {version = ">=0.65.2", optional = true}
57
- litestar = {version = ">=2", optional = true, python = ">=3.8"}
57
+ litestar = {version = ">=2", optional = true}
58
58
  channels = {version = ">=3.0.5", optional = true}
59
- astunparse = {version = "^1.6.3", python = "<3.9"}
60
59
  libcst = {version = ">=0.4.7", optional = true}
61
60
  rich = {version = ">=12.0.0", optional = true}
62
61
  pyinstrument = {version = ">=4.0.0", optional = true}
63
- graphlib_backport = {version = "*", python = "<3.9", optional = true}
64
62
 
65
63
  [tool.poetry.group.dev.dependencies]
66
64
  asgiref = "^3.2"
@@ -195,12 +193,12 @@ append-github-contributor = true
195
193
  exclude = ["**/__pycache__",]
196
194
  reportMissingImports = true
197
195
  reportMissingTypeStubs = false
198
- pythonVersion = "3.8"
196
+ pythonVersion = "3.9"
199
197
  stubPath = ""
200
198
 
201
199
  [tool.ruff]
202
200
  line-length = 88
203
- target-version = "py38"
201
+ target-version = "py39"
204
202
  fix = true
205
203
  exclude = [
206
204
  ".bzr",
@@ -240,9 +238,7 @@ ignore = [
240
238
  "S102",
241
239
  "S104",
242
240
  "S324",
243
- "ANN101", # missing annotation for self?
244
241
  # definitely enable these, maybe not in tests
245
- "ANN102",
246
242
  "ANN401",
247
243
  "PGH003",
248
244
  "PGH004",
@@ -287,7 +283,6 @@ ignore = [
287
283
 
288
284
  # enable these, we have some in tests
289
285
  "B006",
290
- "PT004",
291
286
  "PT007",
292
287
  "PT011",
293
288
  "PT012",
@@ -18,39 +18,39 @@ from .types.field import field
18
18
  from .types.info import Info
19
19
  from .types.lazy_type import LazyType, lazy
20
20
  from .types.mutation import mutation, subscription
21
- from .types.object_type import asdict, input, interface, type
21
+ from .types.object_type import asdict, input, interface, type # noqa: A004
22
22
  from .types.private import Private
23
23
  from .types.scalar import scalar
24
24
  from .types.union import union
25
25
  from .types.unset import UNSET
26
26
 
27
27
  __all__ = [
28
- "BasePermission",
29
- "experimental",
30
28
  "ID",
31
- "Info",
32
29
  "UNSET",
33
- "lazy",
30
+ "BasePermission",
31
+ "Info",
34
32
  "LazyType",
35
33
  "Parent",
36
34
  "Private",
37
35
  "Schema",
38
36
  "argument",
37
+ "asdict",
38
+ "auto",
39
39
  "directive",
40
40
  "directive_field",
41
- "schema_directive",
42
41
  "enum",
43
42
  "enum_value",
43
+ "experimental",
44
44
  "federation",
45
45
  "field",
46
46
  "input",
47
47
  "interface",
48
+ "lazy",
48
49
  "mutation",
50
+ "relay",
49
51
  "scalar",
52
+ "schema_directive",
50
53
  "subscription",
51
54
  "type",
52
55
  "union",
53
- "auto",
54
- "asdict",
55
- "relay",
56
56
  ]
@@ -2,23 +2,25 @@ from __future__ import annotations
2
2
 
3
3
  import warnings
4
4
  from typing import (
5
+ TYPE_CHECKING,
5
6
  Any,
6
- Dict,
7
- Mapping,
8
7
  Optional,
9
8
  )
10
9
 
11
10
  from strawberry.test.client import BaseGraphQLTestClient, Response
12
11
 
12
+ if TYPE_CHECKING:
13
+ from collections.abc import Mapping
14
+
13
15
 
14
16
  class GraphQLTestClient(BaseGraphQLTestClient):
15
17
  async def query(
16
18
  self,
17
19
  query: str,
18
- variables: Optional[Dict[str, Mapping]] = None,
19
- headers: Optional[Dict[str, object]] = None,
20
+ variables: Optional[dict[str, Mapping]] = None,
21
+ headers: Optional[dict[str, object]] = None,
20
22
  asserts_errors: Optional[bool] = None,
21
- files: Optional[Dict[str, object]] = None,
23
+ files: Optional[dict[str, object]] = None,
22
24
  assert_no_errors: Optional[bool] = True,
23
25
  ) -> Response:
24
26
  body = self._build_body(query, variables, files)
@@ -51,9 +53,9 @@ class GraphQLTestClient(BaseGraphQLTestClient):
51
53
 
52
54
  async def request(
53
55
  self,
54
- body: Dict[str, object],
55
- headers: Optional[Dict[str, object]] = None,
56
- files: Optional[Dict[str, object]] = None,
56
+ body: dict[str, object],
57
+ headers: Optional[dict[str, object]] = None,
58
+ files: Optional[dict[str, object]] = None,
57
59
  ) -> Any:
58
60
  response = await self._client.post(
59
61
  self.url,
@@ -8,11 +8,7 @@ from json.decoder import JSONDecodeError
8
8
  from typing import (
9
9
  TYPE_CHECKING,
10
10
  Any,
11
- AsyncGenerator,
12
11
  Callable,
13
- Dict,
14
- Iterable,
15
- Mapping,
16
12
  Optional,
17
13
  Union,
18
14
  cast,
@@ -40,6 +36,8 @@ from strawberry.http.typevars import (
40
36
  from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
41
37
 
42
38
  if TYPE_CHECKING:
39
+ from collections.abc import AsyncGenerator, Iterable, Mapping
40
+
43
41
  from strawberry.http import GraphQLHTTPResponse
44
42
  from strawberry.http.ides import GraphQL_IDE
45
43
  from strawberry.schema import BaseSchema
@@ -67,8 +65,8 @@ class AioHTTPRequestAdapter(AsyncHTTPRequestAdapter):
67
65
  async def get_form_data(self) -> FormData:
68
66
  reader = await self.request.multipart()
69
67
 
70
- data: Dict[str, Any] = {}
71
- files: Dict[str, Any] = {}
68
+ data: dict[str, Any] = {}
69
+ files: dict[str, Any] = {}
72
70
 
73
71
  async for field in reader:
74
72
  assert isinstance(field, BodyPartReader)
@@ -224,7 +222,7 @@ class GraphQLView(
224
222
  request: web.Request,
225
223
  stream: Callable[[], AsyncGenerator[str, None]],
226
224
  sub_response: web.Response,
227
- headers: Dict[str, str],
225
+ headers: dict[str, str],
228
226
  ) -> web.StreamResponse:
229
227
  response = web.StreamResponse(
230
228
  status=sub_response.status,
@@ -7,18 +7,15 @@ from collections import abc
7
7
  from enum import Enum
8
8
  from typing import (
9
9
  TYPE_CHECKING,
10
+ Annotated,
10
11
  Any,
11
- Dict,
12
12
  ForwardRef,
13
- List,
14
13
  Optional,
15
- Tuple,
16
- Type,
17
14
  TypeVar,
18
15
  Union,
19
16
  cast,
20
17
  )
21
- from typing_extensions import Annotated, Self, get_args, get_origin
18
+ from typing_extensions import Self, get_args, get_origin
22
19
 
23
20
  from strawberry.types.base import (
24
21
  StrawberryList,
@@ -54,13 +51,13 @@ ASYNC_TYPES = (
54
51
 
55
52
 
56
53
  class StrawberryAnnotation:
57
- __slots__ = "raw_annotation", "namespace", "__resolve_cache__"
54
+ __slots__ = "__resolve_cache__", "namespace", "raw_annotation"
58
55
 
59
56
  def __init__(
60
57
  self,
61
58
  annotation: Union[object, str],
62
59
  *,
63
- namespace: Optional[Dict[str, Any]] = None,
60
+ namespace: Optional[dict[str, Any]] = None,
64
61
  ) -> None:
65
62
  self.raw_annotation = annotation
66
63
  self.namespace = namespace
@@ -78,7 +75,7 @@ class StrawberryAnnotation:
78
75
 
79
76
  @staticmethod
80
77
  def from_annotation(
81
- annotation: object, namespace: Optional[Dict[str, Any]] = None
78
+ annotation: object, namespace: Optional[dict[str, Any]] = None
82
79
  ) -> Optional[StrawberryAnnotation]:
83
80
  if annotation is None:
84
81
  return None
@@ -115,8 +112,8 @@ class StrawberryAnnotation:
115
112
  return evaled_type
116
113
 
117
114
  def _get_type_with_args(
118
- self, evaled_type: Type[Any]
119
- ) -> Tuple[Type[Any], List[Any]]:
115
+ self, evaled_type: type[Any]
116
+ ) -> tuple[type[Any], list[Any]]:
120
117
  if self._is_async_type(evaled_type):
121
118
  return self._get_type_with_args(self._strip_async_type(evaled_type))
122
119
 
@@ -140,7 +137,7 @@ class StrawberryAnnotation:
140
137
  if is_private(evaled_type):
141
138
  return evaled_type
142
139
 
143
- args: List[Any] = []
140
+ args: list[Any] = []
144
141
 
145
142
  evaled_type, args = self._get_type_with_args(evaled_type)
146
143
 
@@ -208,7 +205,7 @@ class StrawberryAnnotation:
208
205
  )
209
206
 
210
207
  # Note that passing a single type to `Union` is equivalent to not using `Union`
211
- # at all. This allows us to not di any checks for how many types have been
208
+ # at all. This allows us to not do any checks for how many types have been
212
209
  # passed as we can safely use `Union` for both optional types
213
210
  # (e.g. `Optional[str]`) and optional unions (e.g.
214
211
  # `Optional[Union[TypeA, TypeB]]`)
@@ -224,7 +221,7 @@ class StrawberryAnnotation:
224
221
  def create_type_var(self, evaled_type: TypeVar) -> StrawberryTypeVar:
225
222
  return StrawberryTypeVar(evaled_type)
226
223
 
227
- def create_union(self, evaled_type: Type[Any], args: list[Any]) -> StrawberryUnion:
224
+ def create_union(self, evaled_type: type[Any], args: list[Any]) -> StrawberryUnion:
228
225
  # Prevent import cycles
229
226
  from strawberry.types.union import StrawberryUnion
230
227
 
@@ -289,7 +286,7 @@ class StrawberryAnnotation:
289
286
  return isinstance(annotation, LazyType)
290
287
 
291
288
  @classmethod
292
- def _is_optional(cls, annotation: Any, args: List[Any]) -> bool:
289
+ def _is_optional(cls, annotation: Any, args: list[Any]) -> bool:
293
290
  """Returns True if the annotation is Optional[SomeType]."""
294
291
  # Optionals are represented as unions
295
292
  if not cls._is_union(annotation, args):
@@ -341,7 +338,7 @@ class StrawberryAnnotation:
341
338
  return False
342
339
 
343
340
  @classmethod
344
- def _is_union(cls, annotation: Any, args: List[Any]) -> bool:
341
+ def _is_union(cls, annotation: Any, args: list[Any]) -> bool:
345
342
  """Returns True if annotation is a Union."""
346
343
  # this check is needed because unions declared with the new syntax `A | B`
347
344
  # don't have a `__origin__` property on them, but they are instances of
@@ -365,7 +362,7 @@ class StrawberryAnnotation:
365
362
  return any(isinstance(arg, StrawberryUnion) for arg in args)
366
363
 
367
364
  @classmethod
368
- def _strip_async_type(cls, annotation: Type[Any]) -> type:
365
+ def _strip_async_type(cls, annotation: type[Any]) -> type:
369
366
  return annotation.__args__[0]
370
367
 
371
368
  @classmethod
@@ -5,13 +5,8 @@ from datetime import timedelta
5
5
  from json import JSONDecodeError
6
6
  from typing import (
7
7
  TYPE_CHECKING,
8
- AsyncGenerator,
9
- AsyncIterator,
10
8
  Callable,
11
- Dict,
12
- Mapping,
13
9
  Optional,
14
- Sequence,
15
10
  Union,
16
11
  cast,
17
12
  )
@@ -46,6 +41,8 @@ from strawberry.http.typevars import (
46
41
  from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
47
42
 
48
43
  if TYPE_CHECKING:
44
+ from collections.abc import AsyncGenerator, AsyncIterator, Mapping, Sequence
45
+
49
46
  from starlette.types import Receive, Scope, Send
50
47
 
51
48
  from strawberry.http import GraphQLHTTPResponse
@@ -231,7 +228,7 @@ class GraphQL(
231
228
  request: Request | WebSocket,
232
229
  stream: Callable[[], AsyncIterator[str]],
233
230
  sub_response: Response,
234
- headers: Dict[str, str],
231
+ headers: dict[str, str],
235
232
  ) -> Response:
236
233
  return StreamingResponse(
237
234
  stream(),
@@ -1,11 +1,12 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
- from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional
4
+ from typing import TYPE_CHECKING, Any, Optional
5
5
 
6
6
  from strawberry.test import BaseGraphQLTestClient
7
7
 
8
8
  if TYPE_CHECKING:
9
+ from collections.abc import Mapping
9
10
  from typing_extensions import Literal
10
11
 
11
12
 
@@ -13,10 +14,10 @@ class GraphQLTestClient(BaseGraphQLTestClient):
13
14
  def _build_body(
14
15
  self,
15
16
  query: str,
16
- variables: Optional[Dict[str, Mapping]] = None,
17
- files: Optional[Dict[str, object]] = None,
18
- ) -> Dict[str, object]:
19
- body: Dict[str, object] = {"query": query}
17
+ variables: Optional[dict[str, Mapping]] = None,
18
+ files: Optional[dict[str, object]] = None,
19
+ ) -> dict[str, object]:
20
+ body: dict[str, object] = {"query": query}
20
21
 
21
22
  if variables:
22
23
  body["variables"] = variables
@@ -34,9 +35,9 @@ class GraphQLTestClient(BaseGraphQLTestClient):
34
35
 
35
36
  def request(
36
37
  self,
37
- body: Dict[str, object],
38
- headers: Optional[Dict[str, object]] = None,
39
- files: Optional[Dict[str, object]] = None,
38
+ body: dict[str, object],
39
+ headers: Optional[dict[str, object]] = None,
40
+ files: Optional[dict[str, object]] = None,
40
41
  ) -> Any:
41
42
  return self._client.post(
42
43
  self.url,
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import warnings
4
- from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional, Union, cast
4
+ from typing import TYPE_CHECKING, Any, Optional, Union, cast
5
5
 
6
6
  from chalice.app import Request, Response
7
7
  from strawberry.http.exceptions import HTTPException
@@ -11,6 +11,8 @@ from strawberry.http.types import HTTPMethod, QueryParams
11
11
  from strawberry.http.typevars import Context, RootValue
12
12
 
13
13
  if TYPE_CHECKING:
14
+ from collections.abc import Mapping
15
+
14
16
  from strawberry.http import GraphQLHTTPResponse
15
17
  from strawberry.http.ides import GraphQL_IDE
16
18
  from strawberry.schema import BaseSchema
@@ -91,7 +93,7 @@ class GraphQLView(
91
93
  message: str,
92
94
  error_code: str,
93
95
  http_status_code: int,
94
- headers: Optional[Dict[str, str | List[str]]] = None,
96
+ headers: Optional[dict[str, str | list[str]]] = None,
95
97
  ) -> Response:
96
98
  """A wrapper for error responses.
97
99
 
@@ -2,15 +2,11 @@ import asyncio
2
2
  import contextlib
3
3
  import warnings
4
4
  from collections import defaultdict
5
+ from collections.abc import AsyncGenerator, Awaitable, Sequence
5
6
  from typing import (
6
7
  Any,
7
- AsyncGenerator,
8
- Awaitable,
9
8
  Callable,
10
- DefaultDict,
11
- List,
12
9
  Optional,
13
- Sequence,
14
10
  )
15
11
  from typing_extensions import Literal, Protocol, TypedDict
16
12
  from weakref import WeakSet
@@ -31,7 +27,7 @@ class ChannelsLayer(Protocol): # pragma: no cover
31
27
 
32
28
  # Default channels API
33
29
 
34
- extensions: List[Literal["groups", "flush"]]
30
+ extensions: list[Literal["groups", "flush"]]
35
31
 
36
32
  async def send(self, channel: str, message: dict) -> None: ...
37
33
 
@@ -62,7 +58,7 @@ class ChannelsConsumer(AsyncConsumer):
62
58
  channel_receive: Callable[[], Awaitable[dict]]
63
59
 
64
60
  def __init__(self, *args: str, **kwargs: Any) -> None:
65
- self.listen_queues: DefaultDict[str, WeakSet[asyncio.Queue]] = defaultdict(
61
+ self.listen_queues: defaultdict[str, WeakSet[asyncio.Queue]] = defaultdict(
66
62
  WeakSet
67
63
  )
68
64
  super().__init__(*args, **kwargs)
@@ -8,10 +8,7 @@ from io import BytesIO
8
8
  from typing import (
9
9
  TYPE_CHECKING,
10
10
  Any,
11
- AsyncGenerator,
12
11
  Callable,
13
- Dict,
14
- Mapping,
15
12
  Optional,
16
13
  Union,
17
14
  )
@@ -35,6 +32,8 @@ from strawberry.types.unset import UNSET
35
32
  from .base import ChannelsConsumer
36
33
 
37
34
  if TYPE_CHECKING:
35
+ from collections.abc import AsyncGenerator, Mapping
36
+
38
37
  from strawberry.http import GraphQLHTTPResponse
39
38
  from strawberry.http.ides import GraphQL_IDE
40
39
  from strawberry.http.types import HTTPMethod, QueryParams
@@ -46,7 +45,7 @@ class ChannelsResponse:
46
45
  content: bytes
47
46
  status: int = 200
48
47
  content_type: str = "application/json"
49
- headers: Dict[bytes, bytes] = dataclasses.field(default_factory=dict)
48
+ headers: dict[bytes, bytes] = dataclasses.field(default_factory=dict)
50
49
 
51
50
 
52
51
  @dataclasses.dataclass
@@ -54,7 +53,7 @@ class MultipartChannelsResponse:
54
53
  stream: Callable[[], AsyncGenerator[str, None]]
55
54
  status: int = 200
56
55
  content_type: str = "multipart/mixed;boundary=graphql;subscriptionSpec=1.0"
57
- headers: Dict[bytes, bytes] = dataclasses.field(default_factory=dict)
56
+ headers: dict[bytes, bytes] = dataclasses.field(default_factory=dict)
58
57
 
59
58
 
60
59
  @dataclasses.dataclass
@@ -279,7 +278,7 @@ class GraphQLHTTPConsumer(
279
278
  request: ChannelsRequest,
280
279
  stream: Callable[[], AsyncGenerator[str, None]],
281
280
  sub_response: TemporalResponse,
282
- headers: Dict[str, str],
281
+ headers: dict[str, str],
283
282
  ) -> MultipartChannelsResponse:
284
283
  status = sub_response.status_code or 200
285
284
 
@@ -5,10 +5,7 @@ import datetime
5
5
  import json
6
6
  from typing import (
7
7
  TYPE_CHECKING,
8
- AsyncGenerator,
9
- Mapping,
10
8
  Optional,
11
- Tuple,
12
9
  TypedDict,
13
10
  Union,
14
11
  )
@@ -22,6 +19,8 @@ from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_P
22
19
  from .base import ChannelsWSConsumer
23
20
 
24
21
  if TYPE_CHECKING:
22
+ from collections.abc import AsyncGenerator, Mapping
23
+
25
24
  from strawberry.http import GraphQLHTTPResponse
26
25
  from strawberry.schema import BaseSchema
27
26
 
@@ -111,7 +110,7 @@ class GraphQLWSConsumer(
111
110
  keep_alive: bool = False,
112
111
  keep_alive_interval: float = 1,
113
112
  debug: bool = False,
114
- subscription_protocols: Tuple[str, str] = (
113
+ subscription_protocols: tuple[str, str] = (
115
114
  GRAPHQL_TRANSPORT_WS_PROTOCOL,
116
115
  GRAPHQL_WS_PROTOCOL,
117
116
  ),
@@ -4,12 +4,7 @@ import uuid
4
4
  from typing import (
5
5
  TYPE_CHECKING,
6
6
  Any,
7
- AsyncIterator,
8
- Dict,
9
- List,
10
7
  Optional,
11
- Tuple,
12
- Type,
13
8
  Union,
14
9
  )
15
10
 
@@ -24,6 +19,7 @@ from strawberry.subscriptions.protocols.graphql_ws import types as ws_types
24
19
  from strawberry.types import ExecutionResult
25
20
 
26
21
  if TYPE_CHECKING:
22
+ from collections.abc import AsyncIterator
27
23
  from types import TracebackType
28
24
  from typing_extensions import Self
29
25
 
@@ -57,7 +53,7 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
57
53
  self,
58
54
  application: ASGIApplication,
59
55
  path: str,
60
- headers: Optional[List[Tuple[bytes, bytes]]] = None,
56
+ headers: Optional[list[tuple[bytes, bytes]]] = None,
61
57
  protocol: str = GRAPHQL_TRANSPORT_WS_PROTOCOL,
62
58
  connection_params: dict = {},
63
59
  **kwargs: Any,
@@ -85,7 +81,7 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
85
81
 
86
82
  async def __aexit__(
87
83
  self,
88
- exc_type: Optional[Type[BaseException]],
84
+ exc_type: Optional[type[BaseException]],
89
85
  exc_val: Optional[BaseException],
90
86
  exc_tb: Optional[TracebackType],
91
87
  ) -> None:
@@ -116,7 +112,7 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
116
112
  # get transformed into `FormattedExecutionResult` on the wire, but we attempt
117
113
  # to do a limited representation of them here, to make testing simpler.
118
114
  async def subscribe(
119
- self, query: str, variables: Optional[Dict] = None
115
+ self, query: str, variables: Optional[dict] = None
120
116
  ) -> Union[ExecutionResult, AsyncIterator[ExecutionResult]]:
121
117
  id_ = uuid.uuid4().hex
122
118
 
@@ -164,7 +160,7 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
164
160
  else:
165
161
  return
166
162
 
167
- def process_errors(self, errors: List[GraphQLFormattedError]) -> List[GraphQLError]:
163
+ def process_errors(self, errors: list[GraphQLFormattedError]) -> list[GraphQLError]:
168
164
  """Reconstructs a GraphQLError from a FormattedGraphQLError."""
169
165
  result = []
170
166
  for f_error in errors:
@@ -3,8 +3,8 @@ from __future__ import annotations
3
3
  import functools
4
4
  import importlib
5
5
  import inspect
6
- from pathlib import Path # noqa: TCH003
7
- from typing import List, Optional, Type, Union, cast
6
+ from pathlib import Path # noqa: TC003
7
+ from typing import Optional, Union, cast
8
8
 
9
9
  import rich
10
10
  import typer
@@ -22,7 +22,7 @@ def _is_codegen_plugin(obj: object) -> bool:
22
22
  )
23
23
 
24
24
 
25
- def _import_plugin(plugin: str) -> Optional[Type[QueryCodegenPlugin]]:
25
+ def _import_plugin(plugin: str) -> Optional[type[QueryCodegenPlugin]]:
26
26
  module_name = plugin
27
27
  symbol_name: Optional[str] = None
28
28
 
@@ -63,7 +63,7 @@ def _import_plugin(plugin: str) -> Optional[Type[QueryCodegenPlugin]]:
63
63
  @functools.lru_cache
64
64
  def _load_plugin(
65
65
  plugin_path: str,
66
- ) -> Union[Type[QueryCodegenPlugin], Type[ConsolePlugin]]:
66
+ ) -> type[Union[QueryCodegenPlugin, ConsolePlugin]]:
67
67
  # try to import plugin_name from current folder
68
68
  # then try to import from strawberry.codegen.plugins
69
69
 
@@ -80,8 +80,8 @@ def _load_plugin(
80
80
 
81
81
 
82
82
  def _load_plugins(
83
- plugin_ids: List[str], query: Path
84
- ) -> List[Union[QueryCodegenPlugin, ConsolePlugin]]:
83
+ plugin_ids: list[str], query: Path
84
+ ) -> list[Union[QueryCodegenPlugin, ConsolePlugin]]:
85
85
  plugins = []
86
86
  for ptype_id in plugin_ids:
87
87
  ptype = _load_plugin(ptype_id)
@@ -93,7 +93,7 @@ def _load_plugins(
93
93
 
94
94
  @app.command(help="Generate code from a query")
95
95
  def codegen(
96
- query: Optional[List[Path]] = typer.Argument(
96
+ query: Optional[list[Path]] = typer.Argument(
97
97
  default=None, exists=True, dir_okay=False
98
98
  ),
99
99
  schema: str = typer.Option(..., help="Python path to the schema file"),
@@ -117,7 +117,7 @@ def codegen(
117
117
  writable=True,
118
118
  resolve_path=True,
119
119
  ),
120
- selected_plugins: List[str] = typer.Option(
120
+ selected_plugins: list[str] = typer.Option(
121
121
  ...,
122
122
  "-p",
123
123
  "--plugins",
@@ -135,7 +135,7 @@ def codegen(
135
135
  console_plugin.before_any_start()
136
136
 
137
137
  for q in query:
138
- plugins = cast(List[QueryCodegenPlugin], _load_plugins(selected_plugins, q))
138
+ plugins = cast(list[QueryCodegenPlugin], _load_plugins(selected_plugins, q))
139
139
 
140
140
  code_generator = QueryCodegen(
141
141
  schema_symbol, plugins=plugins, console_plugin=console_plugin