strawberry-graphql 0.227.0__tar.gz → 0.227.0.dev1713475585__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.
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/PKG-INFO +1 -2
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/pyproject.toml +9 -10
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/ext/mypy_plugin.py +1 -24
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/object_type.py +9 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/object_type.py +8 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/execute.py +5 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/schema.py +11 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/schema_converter.py +33 -0
- strawberry_graphql-0.227.0.dev1713475585/strawberry/schema/validation_rules/one_of.py +80 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema_codegen/__init__.py +87 -96
- strawberry_graphql-0.227.0.dev1713475585/strawberry/schema_directives.py +9 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/type.py +4 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/types/types.py +11 -0
- strawberry_graphql-0.227.0.dev1713475585/strawberry/utils/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/LICENSE +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/README.md +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/__main__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/aiohttp/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/aiohttp/handlers/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/aiohttp/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/aiohttp/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/aiohttp/test/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/aiohttp/test/client.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/aiohttp/views.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/annotation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/arguments.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/asgi/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/asgi/handlers/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/asgi/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/asgi/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/asgi/test/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/asgi/test/client.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/auto.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/chalice/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/chalice/views.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/channels/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/channels/handlers/base.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/channels/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/channels/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/channels/handlers/http_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/channels/handlers/ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/channels/router.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/channels/testing.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/app.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/commands/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/commands/codegen.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/commands/export_schema.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/commands/schema_codegen.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/commands/server.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/commands/upgrade/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/constants.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/debug_server.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/utils/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/cli/utils/load_schema.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codegen/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codegen/exceptions.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codegen/plugins/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codegen/plugins/print_operation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codegen/plugins/python.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codegen/plugins/typescript.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codegen/query_codegen.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codegen/types.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codemods/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/codemods/annotated_unions.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/custom_scalar.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/dataloader.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/directive.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/django/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/django/apps.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/django/context.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/django/test/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/django/test/client.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/django/views.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/enum.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/conflicting_arguments.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/duplicated_type_name.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/exception.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/exception_source.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/invalid_argument_type.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/invalid_union_type.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/missing_field_annotation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/missing_return_annotation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/not_a_strawberry_enum.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/object_is_not_a_class.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/private_strawberry_field.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/scalar_already_registered.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/syntax.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/unresolved_field_type.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/utils/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/exceptions/utils/source_finder.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/_compat.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/conversion.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/conversion_types.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/error_type.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/exceptions.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/fields.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/object_type.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/experimental/pydantic/utils.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/ext/LICENSE +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/ext/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/ext/dataclasses/LICENSE +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/ext/dataclasses/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/ext/dataclasses/dataclasses.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/add_validation_rules.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/base_extension.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/context.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/directives.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/disable_validation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/field_extension.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/mask_errors.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/max_aliases.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/max_tokens.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/parser_cache.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/pyinstrument.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/query_depth_limiter.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/runner.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/tracing/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/tracing/apollo.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/tracing/datadog.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/tracing/opentelemetry.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/tracing/sentry.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/tracing/utils.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/utils.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/extensions/validation_cache.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/fastapi/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/fastapi/context.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/fastapi/handlers/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/fastapi/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/fastapi/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/fastapi/router.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/argument.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/enum.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/field.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/mutation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/scalar.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/schema.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/schema_directive.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/schema_directives.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/types.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/federation/union.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/field.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/field_extensions/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/field_extensions/input_mutation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/file_uploads/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/file_uploads/scalars.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/file_uploads/utils.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/flask/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/flask/views.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/async_base_view.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/base.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/exceptions.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/ides.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/sync_base_view.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/temporal_response.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/types.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/http/typevars.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/lazy_type.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/litestar/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/litestar/controller.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/litestar/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/litestar/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/mutation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/parent.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/permission.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/printer/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/printer/ast_from_value.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/printer/printer.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/private.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/py.typed +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/quart/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/quart/views.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/relay/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/relay/exceptions.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/relay/fields.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/relay/types.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/relay/utils.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/resolvers.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/sanic/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/sanic/context.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/sanic/utils.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/sanic/views.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/scalars.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/base.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/compat.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/config.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/exceptions.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/name_converter.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/types/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/types/base_scalars.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/types/concrete_type.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/types/scalar.py +0 -0
- {strawberry_graphql-0.227.0/strawberry/subscriptions/protocols → strawberry_graphql-0.227.0.dev1713475585/strawberry/schema/validation_rules}/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema_directive.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/starlite/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/starlite/controller.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/starlite/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/starlite/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/static/apollo-sandbox.html +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/static/graphiql.html +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/static/pathfinder.html +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/subscriptions/__init__.py +0 -0
- {strawberry_graphql-0.227.0/strawberry/types/fields → strawberry_graphql-0.227.0.dev1713475585/strawberry/subscriptions/protocols}/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/test/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/test/client.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/tools/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/tools/create_type.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/tools/merge_types.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/types/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/types/execution.py +0 -0
- {strawberry_graphql-0.227.0/strawberry/utils → strawberry_graphql-0.227.0.dev1713475585/strawberry/types/fields}/__init__.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/types/fields/resolver.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/types/graphql.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/types/info.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/types/nodes.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/types/type_resolver.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/union.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/unset.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/aio.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/await_maybe.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/dataclasses.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/debug.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/deprecations.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/graphql_lexer.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/importer.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/inspect.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/logging.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/operation.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/str_converters.py +0 -0
- {strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/utils/typing.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: strawberry-graphql
|
3
|
-
Version: 0.227.0
|
3
|
+
Version: 0.227.0.dev1713475585
|
4
4
|
Summary: A library for creating GraphQL APIs
|
5
5
|
Home-page: https://strawberry.rocks/
|
6
6
|
License: MIT
|
@@ -44,7 +44,6 @@ Requires-Dist: chalice (>=1.22,<2.0) ; extra == "chalice"
|
|
44
44
|
Requires-Dist: channels (>=3.0.5) ; extra == "channels"
|
45
45
|
Requires-Dist: fastapi (>=0.65.2) ; extra == "fastapi"
|
46
46
|
Requires-Dist: flask (>=1.1) ; extra == "flask"
|
47
|
-
Requires-Dist: graphlib_backport ; (python_version < "3.9") and (extra == "cli")
|
48
47
|
Requires-Dist: graphql-core (>=3.2.0,<3.3.0)
|
49
48
|
Requires-Dist: libcst (>=0.4.7) ; extra == "debug" or extra == "debug-server" or extra == "cli"
|
50
49
|
Requires-Dist: litestar (>=2) ; (python_version >= "3.8") and (extra == "litestar")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "strawberry-graphql"
|
3
3
|
packages = [ { include = "strawberry" } ]
|
4
|
-
version = "0.227.0"
|
4
|
+
version = "0.227.0.dev.1713475585"
|
5
5
|
description = "A library for creating GraphQL APIs"
|
6
6
|
authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
|
7
7
|
license = "MIT"
|
@@ -61,14 +61,13 @@ astunparse = {version = "^1.6.3", python = "<3.9"}
|
|
61
61
|
libcst = {version = ">=0.4.7", optional = true}
|
62
62
|
rich = {version = ">=12.0.0", optional = true}
|
63
63
|
pyinstrument = {version = ">=4.0.0", optional = true}
|
64
|
-
graphlib_backport = {version = "*", python = "<3.9", optional = true}
|
65
64
|
|
66
65
|
[tool.poetry.group.dev.dependencies]
|
67
66
|
asgiref = "^3.2"
|
68
|
-
ddtrace = ">=1.6.4"
|
67
|
+
ddtrace = ">=1.6.4,<3.0.0"
|
69
68
|
email-validator = {version = ">=1.1.3,<3.0.0", optional = false}
|
70
69
|
freezegun = "^1.2.1"
|
71
|
-
libcst = {version = ">=0.4.7", optional = false}
|
70
|
+
libcst = {version = ">=0.4.7,<1.2.0", optional = false}
|
72
71
|
MarkupSafe = "2.1.3"
|
73
72
|
nox = "^2023.4.22"
|
74
73
|
nox-poetry = "^1.0.3"
|
@@ -77,7 +76,7 @@ opentelemetry-sdk = "<2"
|
|
77
76
|
pygments = "^2.3"
|
78
77
|
pyinstrument = {version = ">=4.0.0", optional = false}
|
79
78
|
pytest = "^7.2"
|
80
|
-
pytest-asyncio = ">=0.20.3"
|
79
|
+
pytest-asyncio = ">=0.20.3,<0.24.0"
|
81
80
|
pytest-codspeed = "^2.0.1"
|
82
81
|
pytest-cov = "^4.0.0"
|
83
82
|
pytest-emoji = "^0.2.0"
|
@@ -85,11 +84,11 @@ pytest-mock = "^3.10"
|
|
85
84
|
pytest-snapshot = "^0.9.0"
|
86
85
|
pytest-xdist = {extras = ["psutil"], version = "^3.1.0"}
|
87
86
|
python-multipart = ">=0.0.7"
|
88
|
-
rich = {version = ">=12.5.1", optional = false}
|
87
|
+
rich = {version = ">=12.5.1,<14.0.0", optional = false}
|
89
88
|
sanic-testing = ">=22.9,<24.0"
|
90
89
|
sentry-sdk = "^1.39.2"
|
91
90
|
typer = {version = ">=0.7.0", optional = false}
|
92
|
-
types-aiofiles = ">=22.1"
|
91
|
+
types-aiofiles = ">=22.1,<24.0"
|
93
92
|
types-certifi = "^2021.10.8"
|
94
93
|
types-chardet = "^5.0.4"
|
95
94
|
types-freezegun = "^1.1.9"
|
@@ -99,11 +98,11 @@ types-typed-ast = "^1.5.8"
|
|
99
98
|
types-ujson = "^5.6.0"
|
100
99
|
types-protobuf = "^4.23.0.1"
|
101
100
|
mypy = "1.9.0"
|
102
|
-
pytest-mypy-plugins = "
|
101
|
+
pytest-mypy-plugins = ">=1.10,<4.0"
|
103
102
|
poetry-plugin-export = "^1.6.0"
|
104
103
|
# another bug in poetry
|
105
104
|
urllib3 = "<2"
|
106
|
-
|
105
|
+
ruff = "^0.3.7"
|
107
106
|
|
108
107
|
[tool.poetry.group.integrations]
|
109
108
|
optional = true
|
@@ -140,7 +139,7 @@ pydantic = ["pydantic"]
|
|
140
139
|
sanic = ["sanic"]
|
141
140
|
fastapi = ["fastapi", "python-multipart"]
|
142
141
|
chalice = ["chalice"]
|
143
|
-
cli = ["typer", "pygments", "rich", "libcst"
|
142
|
+
cli = ["typer", "pygments", "rich", "libcst"]
|
144
143
|
starlite = ["starlite"]
|
145
144
|
litestar = ["litestar"]
|
146
145
|
pyinstrument = ["pyinstrument"]
|
@@ -11,7 +11,6 @@ from typing import (
|
|
11
11
|
List,
|
12
12
|
Optional,
|
13
13
|
Set,
|
14
|
-
Tuple,
|
15
14
|
Union,
|
16
15
|
cast,
|
17
16
|
)
|
@@ -60,16 +59,11 @@ try:
|
|
60
59
|
except ImportError:
|
61
60
|
TypeVarDef = TypeVarType
|
62
61
|
|
63
|
-
PYDANTIC_VERSION: Optional[Tuple[int, ...]] = None
|
64
|
-
|
65
62
|
# To be compatible with user who don't use pydantic
|
66
63
|
try:
|
67
|
-
import pydantic
|
68
64
|
from pydantic.mypy import METADATA_KEY as PYDANTIC_METADATA_KEY
|
69
65
|
from pydantic.mypy import PydanticModelField
|
70
66
|
|
71
|
-
PYDANTIC_VERSION = tuple(map(int, pydantic.__version__.split(".")))
|
72
|
-
|
73
67
|
from strawberry.experimental.pydantic._compat import IS_PYDANTIC_V1
|
74
68
|
except ImportError:
|
75
69
|
PYDANTIC_METADATA_KEY = ""
|
@@ -470,11 +464,6 @@ def strawberry_pydantic_class_callback(ctx: ClassDefContext) -> None:
|
|
470
464
|
return_type=model_type,
|
471
465
|
)
|
472
466
|
else:
|
473
|
-
extra = {}
|
474
|
-
|
475
|
-
if PYDANTIC_VERSION and PYDANTIC_VERSION >= (2, 7, 0):
|
476
|
-
extra["api"] = ctx.api
|
477
|
-
|
478
467
|
add_method(
|
479
468
|
ctx,
|
480
469
|
"to_pydantic",
|
@@ -485,7 +474,6 @@ def strawberry_pydantic_class_callback(ctx: ClassDefContext) -> None:
|
|
485
474
|
typed=True,
|
486
475
|
force_optional=False,
|
487
476
|
use_alias=True,
|
488
|
-
**extra,
|
489
477
|
)
|
490
478
|
for f in missing_pydantic_fields
|
491
479
|
],
|
@@ -499,23 +487,12 @@ def strawberry_pydantic_class_callback(ctx: ClassDefContext) -> None:
|
|
499
487
|
initializer=None,
|
500
488
|
kind=ARG_OPT,
|
501
489
|
)
|
502
|
-
extra_type = ctx.api.named_type(
|
503
|
-
"builtins.dict",
|
504
|
-
[ctx.api.named_type("builtins.str"), AnyType(TypeOfAny.explicit)],
|
505
|
-
)
|
506
|
-
|
507
|
-
extra_argument = Argument(
|
508
|
-
variable=Var(name="extra", type=UnionType([NoneType(), extra_type])),
|
509
|
-
type_annotation=UnionType([NoneType(), extra_type]),
|
510
|
-
initializer=None,
|
511
|
-
kind=ARG_OPT,
|
512
|
-
)
|
513
490
|
|
514
491
|
add_static_method_to_class(
|
515
492
|
ctx.api,
|
516
493
|
ctx.cls,
|
517
494
|
name="from_pydantic",
|
518
|
-
args=[model_argument
|
495
|
+
args=[model_argument],
|
519
496
|
return_type=fill_typevars(ctx.cls.info),
|
520
497
|
)
|
521
498
|
|
@@ -31,6 +31,7 @@ def _impl_type(
|
|
31
31
|
*,
|
32
32
|
name: Optional[str] = None,
|
33
33
|
description: Optional[str] = None,
|
34
|
+
one_of: Optional[bool] = None,
|
34
35
|
directives: Iterable[object] = (),
|
35
36
|
authenticated: bool = False,
|
36
37
|
keys: Iterable[Union["Key", str]] = (),
|
@@ -54,6 +55,7 @@ def _impl_type(
|
|
54
55
|
Shareable,
|
55
56
|
Tag,
|
56
57
|
)
|
58
|
+
from strawberry.schema_directives import OneOf
|
57
59
|
|
58
60
|
directives = list(directives)
|
59
61
|
|
@@ -83,6 +85,9 @@ def _impl_type(
|
|
83
85
|
if is_interface_object:
|
84
86
|
directives.append(InterfaceObject())
|
85
87
|
|
88
|
+
if one_of:
|
89
|
+
directives.append(OneOf())
|
90
|
+
|
86
91
|
return base_type( # type: ignore
|
87
92
|
cls,
|
88
93
|
name=name,
|
@@ -182,6 +187,7 @@ def input(
|
|
182
187
|
cls: T,
|
183
188
|
*,
|
184
189
|
name: Optional[str] = None,
|
190
|
+
one_of: Optional[bool] = None,
|
185
191
|
description: Optional[str] = None,
|
186
192
|
directives: Sequence[object] = (),
|
187
193
|
inaccessible: bool = UNSET,
|
@@ -200,6 +206,7 @@ def input(
|
|
200
206
|
*,
|
201
207
|
name: Optional[str] = None,
|
202
208
|
description: Optional[str] = None,
|
209
|
+
one_of: Optional[bool] = None,
|
203
210
|
directives: Sequence[object] = (),
|
204
211
|
inaccessible: bool = UNSET,
|
205
212
|
tags: Iterable[str] = (),
|
@@ -211,6 +218,7 @@ def input(
|
|
211
218
|
cls: Optional[T] = None,
|
212
219
|
*,
|
213
220
|
name: Optional[str] = None,
|
221
|
+
one_of: Optional[bool] = None,
|
214
222
|
description: Optional[str] = None,
|
215
223
|
directives: Sequence[object] = (),
|
216
224
|
inaccessible: bool = UNSET,
|
@@ -223,6 +231,7 @@ def input(
|
|
223
231
|
directives=directives,
|
224
232
|
inaccessible=inaccessible,
|
225
233
|
is_input=True,
|
234
|
+
one_of=one_of,
|
226
235
|
tags=tags,
|
227
236
|
)
|
228
237
|
|
{strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/object_type.py
RENAMED
@@ -272,6 +272,7 @@ def input(
|
|
272
272
|
cls: T,
|
273
273
|
*,
|
274
274
|
name: Optional[str] = None,
|
275
|
+
one_of: Optional[bool] = None,
|
275
276
|
description: Optional[str] = None,
|
276
277
|
directives: Optional[Sequence[object]] = (),
|
277
278
|
) -> T:
|
@@ -285,6 +286,7 @@ def input(
|
|
285
286
|
def input(
|
286
287
|
*,
|
287
288
|
name: Optional[str] = None,
|
289
|
+
one_of: Optional[bool] = None,
|
288
290
|
description: Optional[str] = None,
|
289
291
|
directives: Optional[Sequence[object]] = (),
|
290
292
|
) -> Callable[[T], T]:
|
@@ -295,6 +297,7 @@ def input(
|
|
295
297
|
cls: Optional[T] = None,
|
296
298
|
*,
|
297
299
|
name: Optional[str] = None,
|
300
|
+
one_of: Optional[bool] = None,
|
298
301
|
description: Optional[str] = None,
|
299
302
|
directives: Optional[Sequence[object]] = (),
|
300
303
|
):
|
@@ -305,6 +308,11 @@ def input(
|
|
305
308
|
>>> field_abc: str = "ABC"
|
306
309
|
"""
|
307
310
|
|
311
|
+
from strawberry.schema_directives import OneOf
|
312
|
+
|
313
|
+
if one_of:
|
314
|
+
directives = (*(directives or ()), OneOf())
|
315
|
+
|
308
316
|
return type( # type: ignore # not sure why mypy complains here
|
309
317
|
cls,
|
310
318
|
name=name,
|
{strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/execute.py
RENAMED
@@ -23,6 +23,7 @@ from graphql.validation import validate
|
|
23
23
|
|
24
24
|
from strawberry.exceptions import MissingQueryError
|
25
25
|
from strawberry.extensions.runner import SchemaExtensionsRunner
|
26
|
+
from strawberry.schema.validation_rules.one_of import OneOfInputValidationRule
|
26
27
|
from strawberry.types import ExecutionResult
|
27
28
|
|
28
29
|
from .exceptions import InvalidOperationTypeError
|
@@ -55,6 +56,10 @@ def validate_document(
|
|
55
56
|
document: DocumentNode,
|
56
57
|
validation_rules: Tuple[Type[ASTValidationRule], ...],
|
57
58
|
) -> List[GraphQLError]:
|
59
|
+
validation_rules = (
|
60
|
+
*validation_rules,
|
61
|
+
OneOfInputValidationRule,
|
62
|
+
)
|
58
63
|
return validate(
|
59
64
|
schema,
|
60
65
|
document,
|
{strawberry_graphql-0.227.0 → strawberry_graphql-0.227.0.dev1713475585}/strawberry/schema/schema.py
RENAMED
@@ -16,6 +16,8 @@ from typing import (
|
|
16
16
|
)
|
17
17
|
|
18
18
|
from graphql import (
|
19
|
+
GraphQLBoolean,
|
20
|
+
GraphQLField,
|
19
21
|
GraphQLNamedType,
|
20
22
|
GraphQLNonNull,
|
21
23
|
GraphQLSchema,
|
@@ -168,6 +170,7 @@ class Schema(BaseSchema):
|
|
168
170
|
|
169
171
|
self._warn_for_federation_directives()
|
170
172
|
self._resolve_node_ids()
|
173
|
+
self._extend_introspection()
|
171
174
|
|
172
175
|
# Validate schema early because we want developers to know about
|
173
176
|
# possible issues as soon as possible
|
@@ -375,6 +378,14 @@ class Schema(BaseSchema):
|
|
375
378
|
stacklevel=3,
|
376
379
|
)
|
377
380
|
|
381
|
+
def _extend_introspection(self):
|
382
|
+
def _resolve_is_one_of(obj: Any, info: Any) -> bool:
|
383
|
+
return obj.extensions["strawberry-definition"].is_one_of
|
384
|
+
|
385
|
+
instrospection_type = self._schema.type_map["__Type"]
|
386
|
+
instrospection_type.fields["isOneOf"] = GraphQLField(GraphQLBoolean) # type: ignore[attr-defined]
|
387
|
+
instrospection_type.fields["isOneOf"].resolve = _resolve_is_one_of # type: ignore[attr-defined]
|
388
|
+
|
378
389
|
def as_str(self) -> str:
|
379
390
|
return print_schema(self)
|
380
391
|
|
@@ -26,6 +26,7 @@ from graphql import (
|
|
26
26
|
GraphQLDirective,
|
27
27
|
GraphQLEnumType,
|
28
28
|
GraphQLEnumValue,
|
29
|
+
GraphQLError,
|
29
30
|
GraphQLField,
|
30
31
|
GraphQLInputField,
|
31
32
|
GraphQLInputObjectType,
|
@@ -410,6 +411,37 @@ class GraphQLCoreConverter:
|
|
410
411
|
assert isinstance(graphql_object_type, GraphQLInputObjectType) # For mypy
|
411
412
|
return graphql_object_type
|
412
413
|
|
414
|
+
def check_one_of(value: dict[str, Any]) -> dict[str, Any]:
|
415
|
+
if len(value) != 1:
|
416
|
+
raise GraphQLError(
|
417
|
+
f"OneOf Input Object '{type_name}' must specify exactly one key."
|
418
|
+
)
|
419
|
+
|
420
|
+
first_key, first_value = next(iter(value.items()))
|
421
|
+
|
422
|
+
if first_value is None or first_value is UNSET:
|
423
|
+
raise GraphQLError(
|
424
|
+
f"Value for member field '{first_key}' must be non-null"
|
425
|
+
)
|
426
|
+
|
427
|
+
# We are populating all missing keys with `None`, so users
|
428
|
+
# don't have to set an explicit default for the input type
|
429
|
+
# The alternative is to tell them to use `UNSET`, but it looks
|
430
|
+
# a bit unfriendly to use
|
431
|
+
|
432
|
+
for field in type_definition.fields:
|
433
|
+
name = self.config.name_converter.from_field(field)
|
434
|
+
if name not in value:
|
435
|
+
value[name] = None
|
436
|
+
|
437
|
+
return value
|
438
|
+
|
439
|
+
out_type = (
|
440
|
+
check_one_of
|
441
|
+
if type_definition.is_input and type_definition.is_one_of
|
442
|
+
else None
|
443
|
+
)
|
444
|
+
|
413
445
|
graphql_object_type = GraphQLInputObjectType(
|
414
446
|
name=type_name,
|
415
447
|
fields=lambda: self.get_graphql_input_fields(type_definition),
|
@@ -417,6 +449,7 @@ class GraphQLCoreConverter:
|
|
417
449
|
extensions={
|
418
450
|
GraphQLCoreConverter.DEFINITION_BACKREF: type_definition,
|
419
451
|
},
|
452
|
+
out_type=out_type,
|
420
453
|
)
|
421
454
|
|
422
455
|
self.type_map[type_name] = ConcreteType(
|
@@ -0,0 +1,80 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
3
|
+
from graphql import (
|
4
|
+
ExecutableDefinitionNode,
|
5
|
+
GraphQLError,
|
6
|
+
GraphQLNamedType,
|
7
|
+
ObjectValueNode,
|
8
|
+
ValidationContext,
|
9
|
+
ValidationRule,
|
10
|
+
VariableDefinitionNode,
|
11
|
+
get_named_type,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
class OneOfInputValidationRule(ValidationRule):
|
16
|
+
def __init__(self, validation_context: ValidationContext) -> None:
|
17
|
+
super().__init__(validation_context)
|
18
|
+
|
19
|
+
def enter_operation_definition(
|
20
|
+
self, node: ExecutableDefinitionNode, *_args: Any
|
21
|
+
) -> None:
|
22
|
+
self.variable_definitions: dict[str, VariableDefinitionNode] = {}
|
23
|
+
|
24
|
+
def enter_variable_definition(
|
25
|
+
self, node: VariableDefinitionNode, *_args: Any
|
26
|
+
) -> None:
|
27
|
+
self.variable_definitions[node.variable.name.value] = node
|
28
|
+
|
29
|
+
def enter_object_value(self, node: ObjectValueNode, *_args: Any) -> None:
|
30
|
+
type_ = get_named_type(self.context.get_input_type())
|
31
|
+
|
32
|
+
if not type_:
|
33
|
+
return
|
34
|
+
|
35
|
+
strawberry_type = type_.extensions.get("strawberry-definition")
|
36
|
+
|
37
|
+
if strawberry_type and strawberry_type.is_one_of:
|
38
|
+
self.validate_one_of(node, type_)
|
39
|
+
|
40
|
+
def validate_one_of(self, node: ObjectValueNode, type: GraphQLNamedType) -> None:
|
41
|
+
field_node_map = {field.name.value: field for field in node.fields}
|
42
|
+
keys = list(field_node_map.keys())
|
43
|
+
is_not_exactly_one_field = len(keys) != 1
|
44
|
+
|
45
|
+
if is_not_exactly_one_field:
|
46
|
+
self.report_error(
|
47
|
+
GraphQLError(
|
48
|
+
f"OneOf Input Object '{type.name}' must specify exactly one key.",
|
49
|
+
nodes=[node],
|
50
|
+
)
|
51
|
+
)
|
52
|
+
|
53
|
+
return
|
54
|
+
|
55
|
+
value = field_node_map[keys[0]].value
|
56
|
+
is_null_literal = not value or value.kind == "null_value"
|
57
|
+
is_variable = value.kind == "variable"
|
58
|
+
|
59
|
+
if is_null_literal:
|
60
|
+
self.report_error(
|
61
|
+
GraphQLError(
|
62
|
+
f"Field '{type.name}.{keys[0]}' must be non-null.",
|
63
|
+
nodes=[node],
|
64
|
+
)
|
65
|
+
)
|
66
|
+
|
67
|
+
return
|
68
|
+
|
69
|
+
if is_variable:
|
70
|
+
variable_name = value.name.value # type: ignore
|
71
|
+
definition = self.variable_definitions[variable_name]
|
72
|
+
is_nullable_variable = definition.type.kind != "non_null_type"
|
73
|
+
|
74
|
+
if is_nullable_variable:
|
75
|
+
self.report_error(
|
76
|
+
GraphQLError(
|
77
|
+
f"Variable '{variable_name}' must be non-nullable to be used for OneOf Input Object '{type.name}'.",
|
78
|
+
nodes=[node],
|
79
|
+
)
|
80
|
+
)
|