strawberry-graphql 0.257.0.dev1735244504__tar.gz → 0.258.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 (237) hide show
  1. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/PKG-INFO +3 -3
  2. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/pyproject.toml +82 -95
  3. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/__init__.py +2 -0
  4. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/aiohttp/test/client.py +1 -3
  5. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/aiohttp/views.py +3 -3
  6. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/annotation.py +5 -7
  7. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/asgi/__init__.py +4 -4
  8. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/channels/handlers/ws_handler.py +3 -3
  9. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/channels/testing.py +3 -1
  10. strawberry_graphql-0.258.0/strawberry/cli/__init__.py +17 -0
  11. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/commands/codegen.py +12 -14
  12. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/commands/server.py +2 -2
  13. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/commands/upgrade/_run_codemod.py +2 -3
  14. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/utils/__init__.py +1 -1
  15. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codegen/plugins/python.py +4 -5
  16. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codegen/plugins/typescript.py +3 -2
  17. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codegen/query_codegen.py +12 -11
  18. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codemods/annotated_unions.py +1 -1
  19. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codemods/update_imports.py +2 -4
  20. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/dataloader.py +2 -2
  21. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/django/__init__.py +2 -2
  22. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/django/views.py +2 -3
  23. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/__init__.py +4 -2
  24. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/exception.py +1 -1
  25. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/permission_fail_silently_requires_optional.py +2 -1
  26. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/utils/source_finder.py +1 -1
  27. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/_compat.py +4 -4
  28. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/conversion.py +4 -5
  29. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/fields.py +1 -2
  30. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/object_type.py +6 -2
  31. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/utils.py +3 -9
  32. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/ext/mypy_plugin.py +7 -14
  33. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/context.py +15 -19
  34. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/field_extension.py +53 -54
  35. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/query_depth_limiter.py +27 -33
  36. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/tracing/datadog.py +1 -1
  37. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/tracing/opentelemetry.py +9 -14
  38. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/fastapi/router.py +2 -3
  39. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/schema.py +3 -3
  40. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/flask/views.py +3 -2
  41. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/async_base_view.py +2 -4
  42. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/ides.py +1 -3
  43. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/sync_base_view.py +1 -2
  44. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/litestar/controller.py +6 -5
  45. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/permission.py +1 -1
  46. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/quart/views.py +2 -2
  47. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/relay/fields.py +38 -4
  48. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/relay/types.py +6 -1
  49. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/relay/utils.py +6 -1
  50. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/base.py +0 -2
  51. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/execute.py +11 -11
  52. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/name_converter.py +4 -5
  53. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/schema.py +6 -4
  54. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/schema_converter.py +24 -19
  55. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/subscribe.py +4 -4
  56. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/types/base_scalars.py +4 -2
  57. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/types/scalar.py +1 -1
  58. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema_codegen/__init__.py +5 -6
  59. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +2 -2
  60. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -3
  61. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/test/client.py +1 -2
  62. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/arguments.py +2 -2
  63. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/auto.py +3 -3
  64. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/base.py +12 -16
  65. strawberry_graphql-0.258.0/strawberry/types/cast.py +35 -0
  66. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/field.py +11 -7
  67. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/fields/resolver.py +12 -19
  68. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/union.py +1 -1
  69. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/unset.py +1 -2
  70. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/debug.py +1 -1
  71. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/deprecations.py +1 -1
  72. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/graphql_lexer.py +6 -4
  73. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/typing.py +1 -2
  74. strawberry_graphql-0.257.0.dev1735244504/strawberry/cli/__init__.py +0 -15
  75. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/LICENSE +0 -0
  76. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/README.md +0 -0
  77. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/__main__.py +0 -0
  78. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/aiohttp/__init__.py +0 -0
  79. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/aiohttp/test/__init__.py +0 -0
  80. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/asgi/test/__init__.py +0 -0
  81. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/asgi/test/client.py +0 -0
  82. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/chalice/__init__.py +0 -0
  83. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/chalice/views.py +0 -0
  84. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/channels/__init__.py +0 -0
  85. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/channels/handlers/__init__.py +0 -0
  86. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/channels/handlers/base.py +0 -0
  87. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/channels/handlers/http_handler.py +0 -0
  88. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/channels/router.py +0 -0
  89. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/app.py +0 -0
  90. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/commands/__init__.py +0 -0
  91. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/commands/export_schema.py +0 -0
  92. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/commands/schema_codegen.py +0 -0
  93. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/commands/upgrade/__init__.py +0 -0
  94. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
  95. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/constants.py +0 -0
  96. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/debug_server.py +0 -0
  97. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/cli/utils/load_schema.py +0 -0
  98. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codegen/__init__.py +0 -0
  99. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codegen/exceptions.py +0 -0
  100. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codegen/plugins/__init__.py +0 -0
  101. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codegen/plugins/print_operation.py +0 -0
  102. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codegen/types.py +0 -0
  103. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/codemods/__init__.py +0 -0
  104. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/directive.py +0 -0
  105. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/django/apps.py +0 -0
  106. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/django/context.py +0 -0
  107. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/django/test/__init__.py +0 -0
  108. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/django/test/client.py +0 -0
  109. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/conflicting_arguments.py +0 -0
  110. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/duplicated_type_name.py +0 -0
  111. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/exception_source.py +0 -0
  112. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/handler.py +0 -0
  113. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/invalid_argument_type.py +0 -0
  114. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/invalid_union_type.py +0 -0
  115. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
  116. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/missing_dependencies.py +0 -0
  117. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/missing_field_annotation.py +0 -0
  118. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/missing_return_annotation.py +0 -0
  119. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/object_is_not_a_class.py +0 -0
  120. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
  121. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/private_strawberry_field.py +0 -0
  122. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/scalar_already_registered.py +0 -0
  123. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/syntax.py +0 -0
  124. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/unresolved_field_type.py +0 -0
  125. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/exceptions/utils/__init__.py +0 -0
  126. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/__init__.py +0 -0
  127. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/__init__.py +0 -0
  128. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/conversion_types.py +0 -0
  129. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/error_type.py +0 -0
  130. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/experimental/pydantic/exceptions.py +0 -0
  131. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/ext/LICENSE +0 -0
  132. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/ext/__init__.py +0 -0
  133. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/ext/dataclasses/LICENSE +0 -0
  134. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/ext/dataclasses/__init__.py +0 -0
  135. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/ext/dataclasses/dataclasses.py +0 -0
  136. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/__init__.py +0 -0
  137. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/add_validation_rules.py +0 -0
  138. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/base_extension.py +0 -0
  139. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/directives.py +0 -0
  140. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/disable_validation.py +0 -0
  141. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/mask_errors.py +0 -0
  142. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/max_aliases.py +0 -0
  143. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/max_tokens.py +0 -0
  144. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/parser_cache.py +0 -0
  145. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/pyinstrument.py +0 -0
  146. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/runner.py +0 -0
  147. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/tracing/__init__.py +0 -0
  148. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/tracing/apollo.py +0 -0
  149. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/tracing/utils.py +0 -0
  150. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/utils.py +0 -0
  151. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/extensions/validation_cache.py +0 -0
  152. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/fastapi/__init__.py +0 -0
  153. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/fastapi/context.py +0 -0
  154. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/__init__.py +0 -0
  155. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/argument.py +0 -0
  156. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/enum.py +0 -0
  157. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/field.py +0 -0
  158. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/mutation.py +0 -0
  159. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/object_type.py +0 -0
  160. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/scalar.py +0 -0
  161. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/schema_directive.py +0 -0
  162. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/schema_directives.py +0 -0
  163. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/types.py +0 -0
  164. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/federation/union.py +0 -0
  165. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/field_extensions/__init__.py +0 -0
  166. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/field_extensions/input_mutation.py +0 -0
  167. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/file_uploads/__init__.py +0 -0
  168. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/file_uploads/scalars.py +0 -0
  169. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/file_uploads/utils.py +0 -0
  170. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/flask/__init__.py +0 -0
  171. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/__init__.py +0 -0
  172. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/base.py +0 -0
  173. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/exceptions.py +0 -0
  174. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/parse_content_type.py +0 -0
  175. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/temporal_response.py +0 -0
  176. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/types.py +0 -0
  177. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/http/typevars.py +0 -0
  178. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/litestar/__init__.py +0 -0
  179. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/parent.py +0 -0
  180. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/printer/__init__.py +0 -0
  181. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/printer/ast_from_value.py +0 -0
  182. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/printer/printer.py +0 -0
  183. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/py.typed +0 -0
  184. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/quart/__init__.py +0 -0
  185. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/relay/__init__.py +0 -0
  186. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/relay/exceptions.py +0 -0
  187. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/resolvers.py +0 -0
  188. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/sanic/__init__.py +0 -0
  189. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/sanic/context.py +0 -0
  190. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/sanic/utils.py +0 -0
  191. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/sanic/views.py +0 -0
  192. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/scalars.py +0 -0
  193. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/__init__.py +0 -0
  194. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/compat.py +0 -0
  195. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/config.py +0 -0
  196. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/exceptions.py +0 -0
  197. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/types/__init__.py +0 -0
  198. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/types/concrete_type.py +0 -0
  199. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/validation_rules/__init__.py +0 -0
  200. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema/validation_rules/one_of.py +0 -0
  201. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema_directive.py +0 -0
  202. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/schema_directives.py +0 -0
  203. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/static/apollo-sandbox.html +0 -0
  204. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/static/graphiql.html +0 -0
  205. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/static/pathfinder.html +0 -0
  206. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/subscriptions/__init__.py +0 -0
  207. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/subscriptions/protocols/__init__.py +0 -0
  208. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
  209. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
  210. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
  211. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
  212. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/test/__init__.py +0 -0
  213. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/tools/__init__.py +0 -0
  214. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/tools/create_type.py +0 -0
  215. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/tools/merge_types.py +0 -0
  216. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/__init__.py +0 -0
  217. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/enum.py +0 -0
  218. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/execution.py +0 -0
  219. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/fields/__init__.py +0 -0
  220. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/graphql.py +0 -0
  221. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/info.py +0 -0
  222. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/lazy_type.py +0 -0
  223. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/mutation.py +0 -0
  224. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/nodes.py +0 -0
  225. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/object_type.py +0 -0
  226. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/private.py +0 -0
  227. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/scalar.py +0 -0
  228. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/types/type_resolver.py +0 -0
  229. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/__init__.py +0 -0
  230. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/aio.py +0 -0
  231. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/await_maybe.py +0 -0
  232. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/dataclasses.py +0 -0
  233. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/importer.py +0 -0
  234. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/inspect.py +0 -0
  235. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/logging.py +0 -0
  236. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/operation.py +0 -0
  237. {strawberry_graphql-0.257.0.dev1735244504 → strawberry_graphql-0.258.0}/strawberry/utils/str_converters.py +0 -0
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.257.0.dev1735244504
3
+ Version: 0.258.0
4
4
  Summary: A library for creating GraphQL APIs
5
- Home-page: https://strawberry.rocks/
6
5
  License: MIT
7
6
  Keywords: graphql,api,rest,starlette,async
8
7
  Author: Patrick Arminio
@@ -62,6 +61,7 @@ Requires-Dist: uvicorn (>=0.11.6) ; extra == "debug-server"
62
61
  Project-URL: Changelog, https://strawberry.rocks/changelog
63
62
  Project-URL: Documentation, https://strawberry.rocks/
64
63
  Project-URL: Discord, https://discord.com/invite/3uQ2PaY
64
+ Project-URL: Homepage, https://strawberry.rocks/
65
65
  Project-URL: Mastodon, https://farbun.social/@strawberry
66
66
  Project-URL: Repository, https://github.com/strawberry-graphql/strawberry
67
67
  Project-URL: Sponsor on GitHub, https://github.com/sponsors/strawberry-graphql
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "strawberry-graphql"
3
3
  packages = [ { include = "strawberry" } ]
4
- version = "0.257.0.dev.1735244504"
4
+ version = "0.258.0"
5
5
  description = "A library for creating GraphQL APIs"
6
6
  authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
7
7
  license = "MIT"
@@ -228,125 +228,69 @@ src = ["strawberry", "tests"]
228
228
  select = ["ALL"]
229
229
  ignore = [
230
230
  # https://github.com/astral-sh/ruff/pull/4427
231
- # equivalent to keep-runtime-typing
231
+ # equivalent to keep-runtime-typing. We might want to enable those
232
+ # after we drop support for Python 3.9
232
233
  "UP006",
233
234
  "UP007",
234
235
 
235
- "TID252",
236
236
  # we use asserts in tests and to hint mypy
237
237
  "S101",
238
- "S102",
239
- "S104",
240
- "S324",
241
- # definitely enable these, maybe not in tests
238
+
239
+ # Allow "Any" for annotations. We have too many Any annotations and some
240
+ # are legit. Maybe reconsider in the future, except for tests?
242
241
  "ANN401",
243
- "PGH003",
244
- "PGH004",
245
- "RET504",
246
- "RET505",
247
- "RET506",
248
- "RET507",
249
- "RET503",
250
- "BLE001",
251
- "B008",
252
- "N811",
253
- "N804",
242
+
243
+ # Allow our exceptions to have names that don't end in "Error". Maybe refactor
244
+ # in the future? But that would be a breaking change.
254
245
  "N818",
246
+
247
+ # Allow "type: ignore" without rule code. Because we support both mypy and
248
+ # pyright, and they have different codes for the same error, we can't properly
249
+ # fix those issues.
250
+ "PGH003",
251
+
255
252
  # Variable `T` in function should be lowercase
256
253
  # this seems a potential bug or opportunity for improvement in ruff
257
254
  "N806",
258
255
 
259
- # first argument should named self (found in tests)
260
- "N805",
261
-
262
- "N815",
263
-
264
256
  # shadowing builtins
265
257
  "A001",
266
258
  "A002",
267
259
  "A003",
268
260
 
261
+ # Unused arguments
269
262
  "ARG001",
270
263
  "ARG002",
271
264
  "ARG003",
272
265
  "ARG004",
273
266
  "ARG005",
267
+
268
+ # Boolean positional arguments
274
269
  "FBT001",
275
270
  "FBT002",
276
271
  "FBT003",
277
272
 
278
- "PT001",
279
- "PT023",
280
-
281
- # this is pretty much handled by black
282
- "E501",
283
-
284
- # enable these, we have some in tests
285
- "B006",
286
- "PT007",
287
- "PT011",
288
- "PT012",
289
- "PT015",
290
- "PT017",
291
- "C414",
292
- "N802",
293
-
294
- "SIM117",
295
- "SIM102",
296
-
297
- "F841",
298
- "B027",
299
- "B905",
300
- "ISC001",
301
-
302
- # same?
303
- "S105",
304
- "S106",
273
+ # Too many arguments/branches/return statements
274
+ "PLR0913",
275
+ "PLR0912",
276
+ "PLR0911",
305
277
 
306
- "DTZ003",
307
- "DTZ005",
278
+ # Do not force adding _co to covariant typevars
279
+ "PLC0105",
308
280
 
309
- "RSE102",
281
+ # Allow private access to attributes
310
282
  "SLF001",
311
283
 
312
- # in tests
313
- "DTZ001",
314
-
315
- "EM101",
316
- "EM102",
317
- "EM103",
318
-
319
- "B904",
320
- "B019",
321
-
322
- "N801",
323
- "N807",
324
-
325
- # pandas
326
- "PD",
327
-
328
- "RUF012",
329
- "PLC0105",
330
- "FA102",
331
-
332
284
  # code complexity
333
- "C",
334
285
  "C901",
335
286
 
336
- # trailing commas
337
- "COM812",
338
-
339
- "PLR",
340
- "INP",
341
- "TRY",
342
- "SIM300",
343
- "SIM114",
344
-
345
- "DJ008",
287
+ # Allow todo/fixme/etc comments
346
288
  "TD002",
347
289
  "TD003",
348
290
  "FIX001",
349
291
  "FIX002",
292
+
293
+ # We don't want to add "from __future__ mport annotations" everywhere
350
294
  "FA100",
351
295
 
352
296
  # Docstrings, maybe to enable later
@@ -359,29 +303,72 @@ ignore = [
359
303
  "D106",
360
304
  "D107",
361
305
  "D412",
306
+
307
+ # Allow to define exceptions text in the exception body
308
+ "TRY003",
309
+ "EM101",
310
+ "EM102",
311
+ "EM103",
312
+
313
+ # Allow comparisons with magic numbers
314
+ "PLR2004",
315
+
316
+ # Allow methods to use lru_cache
317
+ "B019",
318
+
319
+ # Don't force if branches to be converted to "or"
320
+ "SIM114",
321
+
322
+ # ruff formatter recommends to disable those, as they conflict with it
323
+ # we don't need to ever enable those.
324
+ "COM812",
325
+ "COM819",
326
+ "D206",
327
+ "E111",
328
+ "E114",
329
+ "E117",
330
+ "E501",
331
+ "ISC001",
332
+ "Q000",
333
+ "Q001",
334
+ "Q002",
335
+ "Q003",
336
+ "W191",
362
337
  ]
363
338
 
364
339
  [tool.ruff.lint.per-file-ignores]
365
- "strawberry/schema/types/concrete_type.py" = ["TCH002"]
340
+ ".github/*" = ["INP001"]
341
+ "federation-compatibility/*" = ["INP001"]
342
+ "strawberry/cli/*" = ["B008"]
343
+ "strawberry/extensions/tracing/__init__.py" = ["TCH004"]
344
+ "strawberry/fastapi/*" = ["B008"]
345
+ "strawberry/annotation.py" = ["RET505"]
366
346
  "tests/*" = [
367
- "RSE102",
368
- "SLF001",
369
- "TCH001",
370
- "TCH002",
371
- "TCH003",
372
347
  "ANN001",
373
348
  "ANN201",
374
349
  "ANN202",
375
350
  "ANN204",
376
- "PLW0603",
351
+ "B008",
352
+ "B018",
353
+ "D",
354
+ "DTZ001",
355
+ "DTZ005",
356
+ "FA102",
357
+ "N805",
377
358
  "PLC1901",
359
+ "PLR2004",
360
+ "PLW0603",
361
+ "PT011",
362
+ "RUF012",
363
+ "S105",
364
+ "S106",
378
365
  "S603",
379
366
  "S607",
380
- "B018",
381
- "D",
367
+ "TCH001",
368
+ "TCH002",
369
+ "TCH003",
370
+ "TRY002",
382
371
  ]
383
- "strawberry/extensions/tracing/__init__.py" = ["TCH004"]
384
- "tests/http/clients/__init__.py" = ["F401"]
385
372
 
386
373
  [tool.ruff.lint.isort]
387
374
  known-first-party = ["strawberry"]
@@ -13,6 +13,7 @@ from .schema import Schema
13
13
  from .schema_directive import schema_directive
14
14
  from .types.arguments import argument
15
15
  from .types.auto import auto
16
+ from .types.cast import cast
16
17
  from .types.enum import enum, enum_value
17
18
  from .types.field import field
18
19
  from .types.info import Info
@@ -36,6 +37,7 @@ __all__ = [
36
37
  "argument",
37
38
  "asdict",
38
39
  "auto",
40
+ "cast",
39
41
  "directive",
40
42
  "directive_field",
41
43
  "enum",
@@ -57,13 +57,11 @@ class GraphQLTestClient(BaseGraphQLTestClient):
57
57
  headers: Optional[dict[str, object]] = None,
58
58
  files: Optional[dict[str, object]] = None,
59
59
  ) -> Any:
60
- response = await self._client.post(
60
+ return await self._client.post(
61
61
  self.url,
62
62
  json=body if not files else None,
63
63
  data=body if files else None,
64
64
  )
65
65
 
66
- return response
67
-
68
66
 
69
67
  __all__ = ["GraphQLTestClient"]
@@ -99,12 +99,12 @@ class AioHTTPWebSocketAdapter(AsyncWebSocketAdapter):
99
99
  if ws_message.type == http.WSMsgType.TEXT:
100
100
  try:
101
101
  yield self.view.decode_json(ws_message.data)
102
- except JSONDecodeError:
102
+ except JSONDecodeError as e:
103
103
  if not ignore_parsing_errors:
104
- raise NonJsonMessageReceived()
104
+ raise NonJsonMessageReceived from e
105
105
 
106
106
  elif ws_message.type == http.WSMsgType.BINARY:
107
- raise NonTextMessageReceived()
107
+ raise NonTextMessageReceived
108
108
 
109
109
  async def send_json(self, message: Mapping[str, object]) -> None:
110
110
  try:
@@ -107,9 +107,7 @@ class StrawberryAnnotation:
107
107
  if isinstance(annotation, str):
108
108
  annotation = ForwardRef(annotation)
109
109
 
110
- evaled_type = eval_type(annotation, self.namespace, None)
111
-
112
- return evaled_type
110
+ return eval_type(annotation, self.namespace, None)
113
111
 
114
112
  def _get_type_with_args(
115
113
  self, evaled_type: type[Any]
@@ -155,13 +153,13 @@ class StrawberryAnnotation:
155
153
  # a StrawberryType
156
154
  if self._is_enum(evaled_type):
157
155
  return self.create_enum(evaled_type)
158
- elif self._is_optional(evaled_type, args):
156
+ if self._is_optional(evaled_type, args):
159
157
  return self.create_optional(evaled_type)
160
- elif self._is_union(evaled_type, args):
158
+ if self._is_union(evaled_type, args):
161
159
  return self.create_union(evaled_type, args)
162
- elif is_type_var(evaled_type) or evaled_type is Self:
160
+ if is_type_var(evaled_type) or evaled_type is Self:
163
161
  return self.create_type_var(cast(TypeVar, evaled_type))
164
- elif self._is_strawberry_type(evaled_type):
162
+ if self._is_strawberry_type(evaled_type):
165
163
  # Simply return objects that are already StrawberryTypes
166
164
  return evaled_type
167
165
 
@@ -97,11 +97,11 @@ class ASGIWebSocketAdapter(AsyncWebSocketAdapter):
97
97
  try:
98
98
  text = await self.ws.receive_text()
99
99
  yield self.view.decode_json(text)
100
- except JSONDecodeError: # noqa: PERF203
100
+ except JSONDecodeError as e: # noqa: PERF203
101
101
  if not ignore_parsing_errors:
102
- raise NonJsonMessageReceived()
103
- except KeyError:
104
- raise NonTextMessageReceived()
102
+ raise NonJsonMessageReceived from e
103
+ except KeyError as e:
104
+ raise NonTextMessageReceived from e
105
105
  except WebSocketDisconnect: # pragma: no cover
106
106
  pass
107
107
 
@@ -45,13 +45,13 @@ class ChannelsWebSocketAdapter(AsyncWebSocketAdapter):
45
45
  break
46
46
 
47
47
  if message["message"] is None:
48
- raise NonTextMessageReceived()
48
+ raise NonTextMessageReceived
49
49
 
50
50
  try:
51
51
  yield self.view.decode_json(message["message"])
52
- except json.JSONDecodeError:
52
+ except json.JSONDecodeError as e:
53
53
  if not ignore_parsing_errors:
54
- raise NonJsonMessageReceived()
54
+ raise NonJsonMessageReceived from e
55
55
 
56
56
  async def send_json(self, message: Mapping[str, object]) -> None:
57
57
  serialized_message = self.view.encode_json(message)
@@ -55,7 +55,7 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
55
55
  path: str,
56
56
  headers: Optional[list[tuple[bytes, bytes]]] = None,
57
57
  protocol: str = GRAPHQL_TRANSPORT_WS_PROTOCOL,
58
- connection_params: dict = {},
58
+ connection_params: dict | None = None,
59
59
  **kwargs: Any,
60
60
  ) -> None:
61
61
  """Create a new communicator.
@@ -69,6 +69,8 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
69
69
  subprotocols: an ordered list of preferred subprotocols to be sent to the server.
70
70
  **kwargs: additional arguments to be passed to the `WebsocketCommunicator` constructor.
71
71
  """
72
+ if connection_params is None:
73
+ connection_params = {}
72
74
  self.protocol = protocol
73
75
  subprotocols = kwargs.get("subprotocols", [])
74
76
  subprotocols.append(protocol)
@@ -0,0 +1,17 @@
1
+ try:
2
+ from .app import app
3
+ from .commands.codegen import codegen as codegen # noqa: PLC0414
4
+ from .commands.export_schema import export_schema as export_schema # noqa: PLC0414
5
+ from .commands.schema_codegen import (
6
+ schema_codegen as schema_codegen, # noqa: PLC0414
7
+ )
8
+ from .commands.server import server as server # noqa: PLC0414
9
+ from .commands.upgrade import upgrade as upgrade # noqa: PLC0414
10
+
11
+ def run() -> None:
12
+ app()
13
+
14
+ except ModuleNotFoundError as exc:
15
+ from strawberry.exceptions import MissingOptionalDependenciesError
16
+
17
+ raise MissingOptionalDependenciesError(extras=["cli"]) from exc
@@ -39,23 +39,21 @@ def _import_plugin(plugin: str) -> Optional[type[QueryCodegenPlugin]]:
39
39
 
40
40
  assert _is_codegen_plugin(obj)
41
41
  return obj
42
- else:
42
+
43
+ symbols = {
44
+ key: value for key, value in module.__dict__.items() if not key.startswith("__")
45
+ }
46
+
47
+ if "__all__" in module.__dict__:
43
48
  symbols = {
44
- key: value
45
- for key, value in module.__dict__.items()
46
- if not key.startswith("__")
49
+ name: symbol
50
+ for name, symbol in symbols.items()
51
+ if name in module.__dict__["__all__"]
47
52
  }
48
53
 
49
- if "__all__" in module.__dict__:
50
- symbols = {
51
- name: symbol
52
- for name, symbol in symbols.items()
53
- if name in module.__dict__["__all__"]
54
- }
55
-
56
- for obj in symbols.values():
57
- if _is_codegen_plugin(obj):
58
- return obj
54
+ for obj in symbols.values():
55
+ if _is_codegen_plugin(obj):
56
+ return obj
59
57
 
60
58
  return None
61
59
 
@@ -25,7 +25,7 @@ class LogLevel(str, Enum):
25
25
  @app.command(help="Starts debug server")
26
26
  def server(
27
27
  schema: str,
28
- host: str = typer.Option("0.0.0.0", "-h", "--host", show_default=True),
28
+ host: str = typer.Option("0.0.0.0", "-h", "--host", show_default=True), # noqa: S104
29
29
  port: int = typer.Option(8000, "-p", "--port", show_default=True),
30
30
  log_level: LogLevel = typer.Option(
31
31
  "error",
@@ -60,7 +60,7 @@ def server(
60
60
  "install them by running:\n"
61
61
  r"pip install 'strawberry-graphql\[debug-server]'"
62
62
  )
63
- raise typer.Exit(1)
63
+ raise typer.Exit(1) # noqa: B904
64
64
 
65
65
  load_schema(schema, app_dir=app_dir)
66
66
 
@@ -41,9 +41,8 @@ def _execute_transform_wrap(
41
41
  additional_kwargs["scratch"] = {}
42
42
 
43
43
  # TODO: maybe capture warnings?
44
- with open(os.devnull, "w") as null: # noqa: PTH123
45
- with contextlib.redirect_stderr(null):
46
- return _execute_transform(**job, **additional_kwargs)
44
+ with open(os.devnull, "w") as null, contextlib.redirect_stderr(null): # noqa: PTH123
45
+ return _execute_transform(**job, **additional_kwargs)
47
46
 
48
47
 
49
48
  def _get_progress_and_pool(
@@ -16,7 +16,7 @@ def load_schema(schema: str, app_dir: str) -> Schema:
16
16
  message = str(exc)
17
17
 
18
18
  rich.print(f"[red]Error: {message}")
19
- raise typer.Exit(2)
19
+ raise typer.Exit(2) # noqa: B904
20
20
 
21
21
  if not isinstance(schema_symbol, Schema):
22
22
  message = "The `schema` must be an instance of strawberry.Schema"
@@ -3,7 +3,7 @@ from __future__ import annotations
3
3
  import textwrap
4
4
  from collections import defaultdict
5
5
  from dataclasses import dataclass
6
- from typing import TYPE_CHECKING, Optional
6
+ from typing import TYPE_CHECKING, ClassVar, Optional
7
7
 
8
8
  from strawberry.codegen import CodegenFile, QueryCodegenPlugin
9
9
  from strawberry.codegen.types import (
@@ -35,7 +35,7 @@ class PythonType:
35
35
 
36
36
 
37
37
  class PythonPlugin(QueryCodegenPlugin):
38
- SCALARS_TO_PYTHON_TYPES: dict[str, PythonType] = {
38
+ SCALARS_TO_PYTHON_TYPES: ClassVar[dict[str, PythonType]] = {
39
39
  "ID": PythonType("str"),
40
40
  "Int": PythonType("int"),
41
41
  "String": PythonType("str"),
@@ -128,7 +128,7 @@ class PythonPlugin(QueryCodegenPlugin):
128
128
  + ", ".join(self._print_argument_value(v) for v in argval.values)
129
129
  + "]"
130
130
  )
131
- elif isinstance(argval.values, dict):
131
+ if isinstance(argval.values, dict):
132
132
  return (
133
133
  "{"
134
134
  + ", ".join(
@@ -137,8 +137,7 @@ class PythonPlugin(QueryCodegenPlugin):
137
137
  )
138
138
  + "}"
139
139
  )
140
- else:
141
- raise TypeError(f"Unrecognized values type: {argval}")
140
+ raise TypeError(f"Unrecognized values type: {argval}")
142
141
  if isinstance(argval, GraphQLEnumValue):
143
142
  # This is an enum. It needs the namespace alongside the name.
144
143
  if argval.enum_type is None:
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import textwrap
4
- from typing import TYPE_CHECKING
4
+ from typing import TYPE_CHECKING, ClassVar
5
5
 
6
6
  from strawberry.codegen import CodegenFile, QueryCodegenPlugin
7
7
  from strawberry.codegen.types import (
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
20
20
 
21
21
 
22
22
  class TypeScriptPlugin(QueryCodegenPlugin):
23
- SCALARS_TO_TS_TYPE = {
23
+ SCALARS_TO_TS_TYPE: ClassVar[dict[str | type, str]] = {
24
24
  "ID": "string",
25
25
  "Int": "number",
26
26
  "String": "string",
@@ -102,6 +102,7 @@ class TypeScriptPlugin(QueryCodegenPlugin):
102
102
  if type_.name in self.SCALARS_TO_TS_TYPE:
103
103
  return ""
104
104
 
105
+ assert type_.python_type is not None
105
106
  return f"type {type_.name} = {self.SCALARS_TO_TS_TYPE[type_.python_type]}"
106
107
 
107
108
  def _print_union_type(self, type_: GraphQLUnion) -> str:
@@ -202,7 +202,7 @@ def _get_deps(t: GraphQLType) -> Iterable[GraphQLType]:
202
202
  yield from _get_deps(gql_type)
203
203
  else:
204
204
  # Want to make sure that all types are covered.
205
- raise ValueError(f"Unknown GraphQLType: {t}")
205
+ raise ValueError(f"Unknown GraphQLType: {t}") # noqa: TRY004
206
206
 
207
207
 
208
208
  _TYPE_TO_GRAPHQL_TYPE = {
@@ -249,14 +249,15 @@ class QueryCodegenPluginManager:
249
249
  def type_cmp(t1: GraphQLType, t2: GraphQLType) -> int:
250
250
  """Compare the types."""
251
251
  if t1 is t2:
252
- return 0
253
-
254
- if t1 in _get_deps(t2):
255
- return -1
252
+ retval = 0
253
+ elif t1 in _get_deps(t2):
254
+ retval = -1
256
255
  elif t2 in _get_deps(t1):
257
- return 1
256
+ retval = 1
258
257
  else:
259
- return 0
258
+ retval = 0
259
+
260
+ return retval
260
261
 
261
262
  return sorted(types, key=cmp_to_key(type_cmp))
262
263
 
@@ -311,15 +312,15 @@ class QueryCodegen:
311
312
  operations = self._get_operations(ast)
312
313
 
313
314
  if not operations:
314
- raise NoOperationProvidedError()
315
+ raise NoOperationProvidedError
315
316
 
316
317
  if len(operations) > 1:
317
- raise MultipleOperationsProvidedError()
318
+ raise MultipleOperationsProvidedError
318
319
 
319
320
  operation = operations[0]
320
321
 
321
322
  if operation.name is None:
322
- raise NoOperationNameProvidedError()
323
+ raise NoOperationNameProvidedError
323
324
 
324
325
  # Look for any free-floating fragments and create types out of them
325
326
  # These types can then be referenced and included later via the
@@ -550,7 +551,7 @@ class QueryCodegen:
550
551
  if isinstance(field_type, ScalarDefinition):
551
552
  return self._collect_scalar(field_type, None)
552
553
 
553
- elif isinstance(field_type, EnumDefinition):
554
+ if isinstance(field_type, EnumDefinition):
554
555
  return self._collect_enum(field_type)
555
556
 
556
557
  raise ValueError(f"Unsupported type: {field_type}") # pragma: no cover
@@ -50,7 +50,7 @@ class ConvertUnionToAnnotatedUnion(VisitorBasedCodemodCommand):
50
50
 
51
51
  super().__init__(context)
52
52
 
53
- def visit_Module(self, node: cst.Module) -> Optional[bool]:
53
+ def visit_Module(self, node: cst.Module) -> Optional[bool]: # noqa: N802
54
54
  self._is_using_named_import = False
55
55
 
56
56
  return super().visit_Module(node)
@@ -126,11 +126,9 @@ class UpdateImportsCodemod(VisitorBasedCodemodCommand):
126
126
 
127
127
  return updated_node
128
128
 
129
- def leave_ImportFrom(
129
+ def leave_ImportFrom( # noqa: N802
130
130
  self, node: cst.ImportFrom, updated_node: cst.ImportFrom
131
131
  ) -> cst.ImportFrom:
132
132
  updated_node = self._update_imports(updated_node, updated_node)
133
133
  updated_node = self._update_types_types_imports(updated_node, updated_node)
134
- updated_node = self._update_strawberry_type_imports(updated_node, updated_node)
135
-
136
- return updated_node
134
+ return self._update_strawberry_type_imports(updated_node, updated_node)
@@ -240,7 +240,7 @@ async def dispatch_batch(loader: DataLoader, batch: Batch) -> None:
240
240
  values = list(values)
241
241
 
242
242
  if len(values) != len(batch):
243
- raise WrongNumberOfResultsReturned(
243
+ raise WrongNumberOfResultsReturned( # noqa: TRY301
244
244
  expected=len(batch), received=len(values)
245
245
  )
246
246
 
@@ -254,7 +254,7 @@ async def dispatch_batch(loader: DataLoader, batch: Batch) -> None:
254
254
  task.future.set_exception(value)
255
255
  else:
256
256
  task.future.set_result(value)
257
- except Exception as e:
257
+ except Exception as e: # noqa: BLE001
258
258
  for task in batch.tasks:
259
259
  task.future.set_exception(e)
260
260