strawberry-graphql 0.266.0.dev1744797470__tar.gz → 0.267.0.dev1746643548__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.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/PKG-INFO +1 -1
  2. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/pyproject.toml +1 -1
  3. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/__init__.py +3 -0
  4. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/annotation.py +10 -0
  5. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/enum.py +7 -1
  6. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/printer/printer.py +8 -0
  7. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/schema_converter.py +8 -3
  8. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/arguments.py +13 -4
  9. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/base.py +10 -1
  10. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/enum.py +11 -3
  11. strawberry_graphql-0.267.0.dev1746643548/strawberry/types/maybe.py +47 -0
  12. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/object_type.py +12 -1
  13. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/LICENSE +0 -0
  14. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/README.md +0 -0
  15. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/__main__.py +0 -0
  16. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/aiohttp/__init__.py +0 -0
  17. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/aiohttp/test/__init__.py +0 -0
  18. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/aiohttp/test/client.py +0 -0
  19. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/aiohttp/views.py +0 -0
  20. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/asgi/__init__.py +0 -0
  21. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/asgi/test/__init__.py +0 -0
  22. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/asgi/test/client.py +0 -0
  23. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/chalice/__init__.py +0 -0
  24. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/chalice/views.py +0 -0
  25. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/channels/__init__.py +0 -0
  26. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/channels/handlers/__init__.py +0 -0
  27. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/channels/handlers/base.py +0 -0
  28. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/channels/handlers/http_handler.py +0 -0
  29. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/channels/handlers/ws_handler.py +0 -0
  30. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/channels/router.py +0 -0
  31. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/channels/testing.py +0 -0
  32. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/__init__.py +0 -0
  33. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/app.py +0 -0
  34. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/commands/__init__.py +0 -0
  35. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/commands/codegen.py +0 -0
  36. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/commands/export_schema.py +0 -0
  37. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/commands/schema_codegen.py +0 -0
  38. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/commands/server.py +0 -0
  39. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/commands/upgrade/__init__.py +0 -0
  40. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
  41. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
  42. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/constants.py +0 -0
  43. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/debug_server.py +0 -0
  44. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/utils/__init__.py +0 -0
  45. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/cli/utils/load_schema.py +0 -0
  46. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codegen/__init__.py +0 -0
  47. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codegen/exceptions.py +0 -0
  48. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codegen/plugins/__init__.py +0 -0
  49. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codegen/plugins/print_operation.py +0 -0
  50. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codegen/plugins/python.py +0 -0
  51. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codegen/plugins/typescript.py +0 -0
  52. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codegen/query_codegen.py +0 -0
  53. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codegen/types.py +0 -0
  54. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codemods/__init__.py +0 -0
  55. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codemods/annotated_unions.py +0 -0
  56. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/codemods/update_imports.py +0 -0
  57. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/dataloader.py +0 -0
  58. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/directive.py +0 -0
  59. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/django/__init__.py +0 -0
  60. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/django/apps.py +0 -0
  61. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/django/context.py +0 -0
  62. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/django/test/__init__.py +0 -0
  63. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/django/test/client.py +0 -0
  64. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/django/views.py +0 -0
  65. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/__init__.py +0 -0
  66. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/conflicting_arguments.py +0 -0
  67. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/duplicated_type_name.py +0 -0
  68. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/exception.py +0 -0
  69. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/exception_source.py +0 -0
  70. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/handler.py +0 -0
  71. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/invalid_argument_type.py +0 -0
  72. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/invalid_union_type.py +0 -0
  73. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
  74. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/missing_dependencies.py +0 -0
  75. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/missing_field_annotation.py +0 -0
  76. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/missing_return_annotation.py +0 -0
  77. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/object_is_not_a_class.py +0 -0
  78. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
  79. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
  80. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/private_strawberry_field.py +0 -0
  81. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/scalar_already_registered.py +0 -0
  82. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/syntax.py +0 -0
  83. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/unresolved_field_type.py +0 -0
  84. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/utils/__init__.py +0 -0
  85. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/exceptions/utils/source_finder.py +0 -0
  86. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/__init__.py +0 -0
  87. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/__init__.py +0 -0
  88. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/_compat.py +0 -0
  89. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/conversion.py +0 -0
  90. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/conversion_types.py +0 -0
  91. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/error_type.py +0 -0
  92. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/exceptions.py +0 -0
  93. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/fields.py +0 -0
  94. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/object_type.py +0 -0
  95. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/experimental/pydantic/utils.py +0 -0
  96. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/ext/LICENSE +0 -0
  97. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/ext/__init__.py +0 -0
  98. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/ext/dataclasses/LICENSE +0 -0
  99. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/ext/dataclasses/__init__.py +0 -0
  100. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/ext/dataclasses/dataclasses.py +0 -0
  101. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/ext/mypy_plugin.py +0 -0
  102. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/__init__.py +0 -0
  103. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/add_validation_rules.py +0 -0
  104. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/base_extension.py +0 -0
  105. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/context.py +0 -0
  106. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/directives.py +0 -0
  107. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/disable_validation.py +0 -0
  108. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/field_extension.py +0 -0
  109. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/mask_errors.py +0 -0
  110. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/max_aliases.py +0 -0
  111. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/max_tokens.py +0 -0
  112. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/parser_cache.py +0 -0
  113. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/pyinstrument.py +0 -0
  114. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/query_depth_limiter.py +0 -0
  115. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/runner.py +0 -0
  116. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/tracing/__init__.py +0 -0
  117. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/tracing/apollo.py +0 -0
  118. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/tracing/datadog.py +0 -0
  119. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/tracing/opentelemetry.py +0 -0
  120. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/tracing/utils.py +0 -0
  121. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/utils.py +0 -0
  122. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/extensions/validation_cache.py +0 -0
  123. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/fastapi/__init__.py +0 -0
  124. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/fastapi/context.py +0 -0
  125. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/fastapi/router.py +0 -0
  126. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/__init__.py +0 -0
  127. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/argument.py +0 -0
  128. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/field.py +0 -0
  129. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/mutation.py +0 -0
  130. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/object_type.py +0 -0
  131. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/scalar.py +0 -0
  132. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/schema.py +0 -0
  133. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/schema_directive.py +0 -0
  134. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/schema_directives.py +0 -0
  135. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/types.py +0 -0
  136. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/federation/union.py +0 -0
  137. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/field_extensions/__init__.py +0 -0
  138. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/field_extensions/input_mutation.py +0 -0
  139. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/file_uploads/__init__.py +0 -0
  140. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/file_uploads/scalars.py +0 -0
  141. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/file_uploads/utils.py +0 -0
  142. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/flask/__init__.py +0 -0
  143. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/flask/views.py +0 -0
  144. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/__init__.py +0 -0
  145. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/async_base_view.py +0 -0
  146. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/base.py +0 -0
  147. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/exceptions.py +0 -0
  148. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/ides.py +0 -0
  149. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/parse_content_type.py +0 -0
  150. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/sync_base_view.py +0 -0
  151. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/temporal_response.py +0 -0
  152. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/types.py +0 -0
  153. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/http/typevars.py +0 -0
  154. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/litestar/__init__.py +0 -0
  155. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/litestar/controller.py +0 -0
  156. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/parent.py +0 -0
  157. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/permission.py +0 -0
  158. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/printer/__init__.py +0 -0
  159. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/printer/ast_from_value.py +0 -0
  160. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/py.typed +0 -0
  161. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/quart/__init__.py +0 -0
  162. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/quart/views.py +0 -0
  163. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/relay/__init__.py +0 -0
  164. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/relay/exceptions.py +0 -0
  165. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/relay/fields.py +0 -0
  166. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/relay/types.py +0 -0
  167. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/relay/utils.py +0 -0
  168. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/resolvers.py +0 -0
  169. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/sanic/__init__.py +0 -0
  170. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/sanic/context.py +0 -0
  171. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/sanic/utils.py +0 -0
  172. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/sanic/views.py +0 -0
  173. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/scalars.py +0 -0
  174. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/__init__.py +0 -0
  175. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/_graphql_core.py +0 -0
  176. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/base.py +0 -0
  177. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/compat.py +0 -0
  178. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/config.py +0 -0
  179. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/exceptions.py +0 -0
  180. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/name_converter.py +0 -0
  181. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/schema.py +0 -0
  182. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/types/__init__.py +0 -0
  183. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/types/base_scalars.py +0 -0
  184. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/types/concrete_type.py +0 -0
  185. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/types/scalar.py +0 -0
  186. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/validation_rules/__init__.py +0 -0
  187. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema/validation_rules/one_of.py +0 -0
  188. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema_codegen/__init__.py +0 -0
  189. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema_directive.py +0 -0
  190. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/schema_directives.py +0 -0
  191. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/static/apollo-sandbox.html +0 -0
  192. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/static/graphiql.html +0 -0
  193. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/static/pathfinder.html +0 -0
  194. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/streamable.py +0 -0
  195. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/subscriptions/__init__.py +0 -0
  196. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/subscriptions/protocols/__init__.py +0 -0
  197. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
  198. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
  199. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
  200. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
  201. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
  202. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
  203. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/test/__init__.py +0 -0
  204. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/test/client.py +0 -0
  205. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/tools/__init__.py +0 -0
  206. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/tools/create_type.py +0 -0
  207. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/tools/merge_types.py +0 -0
  208. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/__init__.py +0 -0
  209. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/auto.py +0 -0
  210. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/cast.py +0 -0
  211. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/execution.py +0 -0
  212. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/field.py +0 -0
  213. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/fields/__init__.py +0 -0
  214. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/fields/resolver.py +0 -0
  215. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/graphql.py +0 -0
  216. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/info.py +0 -0
  217. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/lazy_type.py +0 -0
  218. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/mutation.py +0 -0
  219. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/nodes.py +0 -0
  220. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/private.py +0 -0
  221. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/scalar.py +0 -0
  222. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/type_resolver.py +0 -0
  223. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/union.py +0 -0
  224. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/types/unset.py +0 -0
  225. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/__init__.py +0 -0
  226. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/aio.py +0 -0
  227. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/await_maybe.py +0 -0
  228. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/dataclasses.py +0 -0
  229. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/debug.py +0 -0
  230. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/deprecations.py +0 -0
  231. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/graphql_lexer.py +0 -0
  232. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/importer.py +0 -0
  233. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/inspect.py +0 -0
  234. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/logging.py +0 -0
  235. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/operation.py +0 -0
  236. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/str_converters.py +0 -0
  237. {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.267.0.dev1746643548}/strawberry/utils/typing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.266.0.dev1744797470
3
+ Version: 0.267.0.dev1746643548
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "strawberry-graphql"
3
3
  packages = [ { include = "strawberry" } ]
4
- version = "0.266.0.dev.1744797470"
4
+ version = "0.267.0.dev.1746643548"
5
5
  description = "A library for creating GraphQL APIs"
6
6
  authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
7
7
  license = "MIT"
@@ -19,6 +19,7 @@ from .types.enum import enum, enum_value
19
19
  from .types.field import field
20
20
  from .types.info import Info
21
21
  from .types.lazy_type import LazyType, lazy
22
+ from .types.maybe import Maybe, Some
22
23
  from .types.mutation import mutation, subscription
23
24
  from .types.object_type import asdict, input, interface, type # noqa: A004
24
25
  from .types.private import Private
@@ -32,9 +33,11 @@ __all__ = [
32
33
  "BasePermission",
33
34
  "Info",
34
35
  "LazyType",
36
+ "Maybe",
35
37
  "Parent",
36
38
  "Private",
37
39
  "Schema",
40
+ "Some",
38
41
  "Streamable",
39
42
  "argument",
40
43
  "asdict",
@@ -20,6 +20,7 @@ from typing_extensions import Self, get_args, get_origin
20
20
  from strawberry.streamable import StrawberryStreamable
21
21
  from strawberry.types.base import (
22
22
  StrawberryList,
23
+ StrawberryMaybe,
23
24
  StrawberryObjectDefinition,
24
25
  StrawberryOptional,
25
26
  StrawberryTypeVar,
@@ -29,6 +30,7 @@ from strawberry.types.base import (
29
30
  from strawberry.types.enum import EnumDefinition
30
31
  from strawberry.types.enum import enum as strawberry_enum
31
32
  from strawberry.types.lazy_type import LazyType
33
+ from strawberry.types.maybe import _annotation_is_maybe
32
34
  from strawberry.types.private import is_private
33
35
  from strawberry.types.scalar import ScalarDefinition
34
36
  from strawberry.types.unset import UNSET
@@ -146,6 +148,10 @@ class StrawberryAnnotation:
146
148
  return self.create_list(list[evaled_type])
147
149
  if self._is_list(evaled_type):
148
150
  return self.create_list(evaled_type)
151
+ if type_of := self._get_maybe_type(evaled_type):
152
+ return StrawberryMaybe(
153
+ of_type=type_of,
154
+ )
149
155
 
150
156
  if self._is_graphql_generic(evaled_type):
151
157
  if any(is_type_var(type_) for type_ in get_args(evaled_type)):
@@ -316,6 +322,10 @@ class StrawberryAnnotation:
316
322
  or is_list
317
323
  )
318
324
 
325
+ @classmethod
326
+ def _get_maybe_type(cls, annotation: Any) -> type | None:
327
+ return get_args(annotation)[0] if _annotation_is_maybe(annotation) else None
328
+
319
329
  @classmethod
320
330
  def _is_streamable(cls, annotation: Any, args: list[Any]) -> bool:
321
331
  return any(isinstance(arg, StrawberryStreamable) for arg in args)
@@ -20,6 +20,7 @@ if TYPE_CHECKING:
20
20
 
21
21
  def enum_value(
22
22
  value: Any,
23
+ name: Optional[str] = None,
23
24
  deprecation_reason: Optional[str] = None,
24
25
  directives: Iterable[object] = (),
25
26
  inaccessible: bool = False,
@@ -35,7 +36,12 @@ def enum_value(
35
36
  if tags:
36
37
  directives.extend(Tag(name=tag) for tag in tags)
37
38
 
38
- return base_enum_value(value, deprecation_reason, directives)
39
+ return base_enum_value(
40
+ value=value,
41
+ name=name,
42
+ deprecation_reason=deprecation_reason,
43
+ directives=directives,
44
+ )
39
45
 
40
46
 
41
47
  @overload
@@ -621,6 +621,14 @@ def print_schema(schema: BaseSchema) -> str:
621
621
  if (printed_directive := print_directive(directive, schema=schema)) is not None
622
622
  ]
623
623
 
624
+ if schema.config.enable_experimental_incremental_execution:
625
+ directives.append(
626
+ "directive @defer(if: Boolean, label: String) on FRAGMENT_SPREAD | INLINE_FRAGMENT"
627
+ )
628
+ directives.append(
629
+ "directive @stream(if: Boolean, label: String, initialCount: Int = 0) on FIELD"
630
+ )
631
+
624
632
  def _name_getter(type_: Any) -> str:
625
633
  if hasattr(type_, "name"):
626
634
  return type_.name
@@ -52,6 +52,7 @@ from strawberry.schema.types.scalar import _make_scalar_type
52
52
  from strawberry.types.arguments import StrawberryArgument, convert_arguments
53
53
  from strawberry.types.base import (
54
54
  StrawberryList,
55
+ StrawberryMaybe,
55
56
  StrawberryObjectDefinition,
56
57
  StrawberryOptional,
57
58
  StrawberryType,
@@ -254,7 +255,10 @@ class GraphQLCoreConverter:
254
255
  argument_type = cast(
255
256
  "GraphQLInputType", self.from_maybe_optional(argument.type)
256
257
  )
257
- default_value = Undefined if argument.default is UNSET else argument.default
258
+ if argument.is_maybe:
259
+ default_value: Any = Undefined
260
+ else:
261
+ default_value = Undefined if argument.default is UNSET else argument.default
258
262
 
259
263
  return GraphQLArgument(
260
264
  type_=argument_type,
@@ -419,8 +423,9 @@ class GraphQLCoreConverter:
419
423
  ),
420
424
  )
421
425
  default_value: object
422
-
423
- if field.default_value is UNSET or field.default_value is dataclasses.MISSING:
426
+ if isinstance(field.type, StrawberryMaybe):
427
+ default_value = Undefined
428
+ elif field.default_value is UNSET or field.default_value is dataclasses.MISSING:
424
429
  default_value = Undefined
425
430
  else:
426
431
  default_value = field.default_value
@@ -17,13 +17,17 @@ from strawberry.exceptions import MultipleStrawberryArgumentsError, UnsupportedT
17
17
  from strawberry.scalars import is_scalar
18
18
  from strawberry.types.base import (
19
19
  StrawberryList,
20
+ StrawberryMaybe,
20
21
  StrawberryOptional,
21
22
  has_object_definition,
22
23
  )
23
24
  from strawberry.types.enum import EnumDefinition
24
25
  from strawberry.types.lazy_type import LazyType, StrawberryLazyReference
26
+ from strawberry.types.maybe import Some
25
27
  from strawberry.types.unset import UNSET as _deprecated_UNSET # noqa: N811
26
- from strawberry.types.unset import _deprecated_is_unset # noqa: F401
28
+ from strawberry.types.unset import (
29
+ _deprecated_is_unset, # noqa: F401
30
+ )
27
31
 
28
32
  if TYPE_CHECKING:
29
33
  from collections.abc import Iterable, Mapping
@@ -135,6 +139,10 @@ class StrawberryArgument:
135
139
 
136
140
  return is_graphql_generic(self.type)
137
141
 
142
+ @property
143
+ def is_maybe(self) -> bool:
144
+ return isinstance(self.type, StrawberryMaybe)
145
+
138
146
 
139
147
  def convert_argument(
140
148
  value: object,
@@ -143,6 +151,10 @@ def convert_argument(
143
151
  config: StrawberryConfig,
144
152
  ) -> object:
145
153
  # TODO: move this somewhere else and make it first class
154
+ if isinstance(type_, StrawberryOptional):
155
+ res = convert_argument(value, type_.of_type, scalar_registry, config)
156
+
157
+ return Some(res) if isinstance(type_, StrawberryMaybe) else res
146
158
 
147
159
  if value is None:
148
160
  return None
@@ -150,9 +162,6 @@ def convert_argument(
150
162
  if value is _deprecated_UNSET:
151
163
  return _deprecated_UNSET
152
164
 
153
- if isinstance(type_, StrawberryOptional):
154
- return convert_argument(value, type_.of_type, scalar_registry, config)
155
-
156
165
  if isinstance(type_, StrawberryList):
157
166
  value_list = cast("Iterable", value)
158
167
  return [
@@ -152,7 +152,16 @@ class StrawberryContainer(StrawberryType):
152
152
  class StrawberryList(StrawberryContainer): ...
153
153
 
154
154
 
155
- class StrawberryOptional(StrawberryContainer): ...
155
+ class StrawberryOptional(StrawberryContainer):
156
+ def __init__(
157
+ self,
158
+ of_type: Union[StrawberryType, type[WithStrawberryObjectDefinition], type],
159
+ ) -> None:
160
+ super().__init__(of_type)
161
+
162
+
163
+ class StrawberryMaybe(StrawberryOptional):
164
+ pass
156
165
 
157
166
 
158
167
  class StrawberryTypeVar(StrawberryType):
@@ -50,6 +50,7 @@ class EnumDefinition(StrawberryType):
50
50
  @dataclasses.dataclass
51
51
  class EnumValueDefinition:
52
52
  value: Any
53
+ graphql_name: Optional[str] = None
53
54
  deprecation_reason: Optional[str] = None
54
55
  directives: Iterable[object] = ()
55
56
  description: Optional[str] = None
@@ -60,6 +61,7 @@ class EnumValueDefinition:
60
61
 
61
62
  def enum_value(
62
63
  value: Any,
64
+ name: Optional[str] = None,
63
65
  deprecation_reason: Optional[str] = None,
64
66
  directives: Iterable[object] = (),
65
67
  description: Optional[str] = None,
@@ -68,6 +70,7 @@ def enum_value(
68
70
 
69
71
  Args:
70
72
  value: The value of the enum member.
73
+ name: The GraphQL name of the enum member.
71
74
  deprecation_reason: The deprecation reason of the enum member,
72
75
  setting this will mark the enum member as deprecated.
73
76
  directives: The directives to attach to the enum member.
@@ -90,6 +93,7 @@ def enum_value(
90
93
  """
91
94
  return EnumValueDefinition(
92
95
  value=value,
96
+ graphql_name=name,
93
97
  deprecation_reason=deprecation_reason,
94
98
  directives=directives,
95
99
  description=description,
@@ -123,12 +127,16 @@ def _process_enum(
123
127
  item_directives = item_value.directives
124
128
  enum_value_description = item_value.description
125
129
  deprecation_reason = item_value.deprecation_reason
126
- item_value = item_value.value
127
130
 
128
131
  # update _value2member_map_ so that doing `MyEnum.MY_VALUE` and
129
132
  # `MyEnum['MY_VALUE']` both work
130
- cls._value2member_map_[item_value] = item
131
- cls._member_map_[item_name]._value_ = item_value
133
+ cls._value2member_map_[item_value.value] = item
134
+ cls._member_map_[item_name]._value_ = item_value.value
135
+
136
+ if item_value.graphql_name:
137
+ item_name = item_value.graphql_name
138
+
139
+ item_value = item_value.value
132
140
 
133
141
  value = EnumValue(
134
142
  item_name,
@@ -0,0 +1,47 @@
1
+ import typing
2
+ from typing import TYPE_CHECKING, Any, Generic, TypeVar, Union
3
+ from typing_extensions import TypeAlias
4
+
5
+ T = TypeVar("T")
6
+
7
+
8
+ class Some(Generic[T]):
9
+ """A special value that can be used to represent an unset value in a field or argument.
10
+
11
+ Similar to `undefined` in JavaScript, this value can be used to differentiate between
12
+ a field that was not set and a field that was set to `None` or `null`.
13
+ """
14
+
15
+ __slots__ = ("value",)
16
+
17
+ def __init__(self, value: T) -> None:
18
+ self.value = value
19
+
20
+ def __repr__(self) -> str:
21
+ return f"Some({self.value!r})"
22
+
23
+ def __eq__(self, other: object) -> bool:
24
+ return self.value == other.value if isinstance(other, Some) else False
25
+
26
+ def __hash__(self) -> int:
27
+ return hash(self.value)
28
+
29
+ def __bool__(self) -> bool:
30
+ return True
31
+
32
+
33
+ if TYPE_CHECKING:
34
+ Maybe: TypeAlias = Union[Some[Union[T, None]], None]
35
+ else:
36
+ # we do this trick so we can inspect that at runtime
37
+ class Maybe(Generic[T]): ...
38
+
39
+
40
+ def _annotation_is_maybe(annotation: Any) -> bool:
41
+ return (orig := typing.get_origin(annotation)) and orig is Maybe
42
+
43
+
44
+ __all__ = [
45
+ "Maybe",
46
+ "Some",
47
+ ]
@@ -20,6 +20,7 @@ from strawberry.exceptions import (
20
20
  ObjectIsNotClassError,
21
21
  )
22
22
  from strawberry.types.base import get_object_definition
23
+ from strawberry.types.maybe import _annotation_is_maybe
23
24
  from strawberry.utils.deprecations import DEPRECATION_MESSAGES, DeprecatedDescriptor
24
25
  from strawberry.utils.str_converters import to_camel_case
25
26
 
@@ -122,6 +123,15 @@ def _wrap_dataclass(cls: builtins.type[T]) -> builtins.type[T]:
122
123
  return dclass
123
124
 
124
125
 
126
+ def _inject_default_for_maybe_annotations(
127
+ cls: builtins.type[T], annotations: dict[str, Any]
128
+ ) -> None:
129
+ """Inject `= None` for fields with `Maybe` annotations and no default value."""
130
+ for name, annotation in annotations.copy().items():
131
+ if _annotation_is_maybe(annotation) and not hasattr(cls, name):
132
+ setattr(cls, name, None)
133
+
134
+
125
135
  def _process_type(
126
136
  cls: T,
127
137
  *,
@@ -286,7 +296,8 @@ def type(
286
296
 
287
297
  if field and isinstance(field, StrawberryField) and field.type_annotation:
288
298
  original_type_annotations[field_name] = field.type_annotation.annotation
289
-
299
+ if is_input:
300
+ _inject_default_for_maybe_annotations(cls, annotations)
290
301
  wrapped = _wrap_dataclass(cls)
291
302
 
292
303
  return _process_type( # type: ignore