strawberry-graphql 0.232.1__tar.gz → 0.233.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.
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/PKG-INFO +1 -1
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/pyproject.toml +1 -2
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/custom_scalar.py +5 -6
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/conversion.py +1 -1
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/fastapi/router.py +3 -3
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/scalar.py +3 -4
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/schema.py +85 -94
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/schema_directive.py +1 -1
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/object_type.py +4 -4
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/printer/printer.py +1 -1
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/relay/fields.py +13 -5
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/relay/types.py +1 -1
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/schema.py +3 -3
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/schema_converter.py +12 -7
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/types/base_scalars.py +1 -1
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema_directive.py +1 -1
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/types.py +4 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/typing.py +10 -5
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/LICENSE +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/README.md +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/__main__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/aiohttp/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/aiohttp/handlers/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/aiohttp/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/aiohttp/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/aiohttp/test/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/aiohttp/test/client.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/aiohttp/views.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/annotation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/arguments.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/asgi/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/asgi/handlers/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/asgi/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/asgi/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/asgi/test/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/asgi/test/client.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/auto.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/chalice/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/chalice/views.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/channels/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/channels/handlers/base.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/channels/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/channels/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/channels/handlers/http_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/channels/handlers/ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/channels/router.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/channels/testing.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/app.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/commands/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/commands/codegen.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/commands/export_schema.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/commands/schema_codegen.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/commands/server.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/commands/upgrade/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/constants.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/debug_server.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/utils/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/cli/utils/load_schema.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codegen/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codegen/exceptions.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codegen/plugins/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codegen/plugins/print_operation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codegen/plugins/python.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codegen/plugins/typescript.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codegen/query_codegen.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codegen/types.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codemods/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/codemods/annotated_unions.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/dataloader.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/directive.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/django/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/django/apps.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/django/context.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/django/test/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/django/test/client.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/django/views.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/enum.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/conflicting_arguments.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/duplicated_type_name.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/exception.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/exception_source.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/invalid_argument_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/invalid_union_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/missing_dependencies.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/missing_field_annotation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/missing_return_annotation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/not_a_strawberry_enum.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/object_is_not_a_class.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/private_strawberry_field.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/scalar_already_registered.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/syntax.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/unresolved_field_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/utils/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/exceptions/utils/source_finder.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/_compat.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/conversion_types.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/error_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/exceptions.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/fields.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/object_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/experimental/pydantic/utils.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/ext/LICENSE +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/ext/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/ext/dataclasses/LICENSE +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/ext/dataclasses/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/ext/dataclasses/dataclasses.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/ext/mypy_plugin.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/add_validation_rules.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/base_extension.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/context.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/directives.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/disable_validation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/field_extension.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/mask_errors.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/max_aliases.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/max_tokens.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/parser_cache.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/pyinstrument.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/query_depth_limiter.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/runner.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/tracing/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/tracing/apollo.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/tracing/datadog.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/tracing/opentelemetry.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/tracing/sentry.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/tracing/utils.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/utils.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/extensions/validation_cache.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/fastapi/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/fastapi/context.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/fastapi/handlers/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/fastapi/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/fastapi/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/argument.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/enum.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/field.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/mutation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/object_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/schema_directives.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/types.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/union.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/field.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/field_extensions/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/field_extensions/input_mutation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/file_uploads/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/file_uploads/scalars.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/file_uploads/utils.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/flask/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/flask/views.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/async_base_view.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/base.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/exceptions.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/ides.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/sync_base_view.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/temporal_response.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/types.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/http/typevars.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/lazy_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/litestar/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/litestar/controller.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/litestar/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/litestar/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/mutation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/parent.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/permission.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/printer/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/printer/ast_from_value.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/private.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/py.typed +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/quart/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/quart/views.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/relay/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/relay/exceptions.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/relay/utils.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/resolvers.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/sanic/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/sanic/context.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/sanic/utils.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/sanic/views.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/scalars.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/base.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/compat.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/config.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/exceptions.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/execute.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/name_converter.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/types/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/types/concrete_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/types/scalar.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/validation_rules/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/validation_rules/one_of.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema_codegen/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema_directives.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/starlite/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/starlite/controller.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/starlite/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/starlite/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/static/apollo-sandbox.html +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/static/graphiql.html +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/static/pathfinder.html +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/subscriptions/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/subscriptions/protocols/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/test/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/test/client.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/tools/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/tools/create_type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/tools/merge_types.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/type.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/execution.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/fields/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/fields/resolver.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/graphql.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/info.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/nodes.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/types/type_resolver.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/union.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/unset.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/__init__.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/aio.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/await_maybe.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/dataclasses.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/debug.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/deprecations.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/graphql_lexer.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/importer.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/inspect.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/logging.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/operation.py +0 -0
- {strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/utils/str_converters.py +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "strawberry-graphql"
|
3
3
|
packages = [ { include = "strawberry" } ]
|
4
|
-
version = "0.
|
4
|
+
version = "0.233.0"
|
5
5
|
description = "A library for creating GraphQL APIs"
|
6
6
|
authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
|
7
7
|
license = "MIT"
|
@@ -241,7 +241,6 @@ ignore = [
|
|
241
241
|
"ANN101", # missing annotation for self?
|
242
242
|
# definitely enable these, maybe not in tests
|
243
243
|
"ANN102",
|
244
|
-
"ANN202",
|
245
244
|
"ANN401",
|
246
245
|
"PGH003",
|
247
246
|
"PGH004",
|
@@ -10,7 +10,6 @@ from typing import (
|
|
10
10
|
Mapping,
|
11
11
|
NewType,
|
12
12
|
Optional,
|
13
|
-
Type,
|
14
13
|
TypeVar,
|
15
14
|
Union,
|
16
15
|
overload,
|
@@ -85,7 +84,7 @@ class ScalarWrapper:
|
|
85
84
|
|
86
85
|
|
87
86
|
def _process_scalar(
|
88
|
-
cls:
|
87
|
+
cls: _T,
|
89
88
|
*,
|
90
89
|
name: Optional[str] = None,
|
91
90
|
description: Optional[str] = None,
|
@@ -94,10 +93,10 @@ def _process_scalar(
|
|
94
93
|
parse_value: Optional[Callable] = None,
|
95
94
|
parse_literal: Optional[Callable] = None,
|
96
95
|
directives: Iterable[object] = (),
|
97
|
-
):
|
96
|
+
) -> ScalarWrapper:
|
98
97
|
from strawberry.exceptions.handler import should_use_rich_exceptions
|
99
98
|
|
100
|
-
name = name or to_camel_case(cls.__name__)
|
99
|
+
name = name or to_camel_case(cls.__name__) # type: ignore[union-attr]
|
101
100
|
|
102
101
|
_source_file = None
|
103
102
|
_source_line = None
|
@@ -155,7 +154,7 @@ def scalar(
|
|
155
154
|
# here or else it won't let us use any custom scalar to annotate attributes in
|
156
155
|
# dataclasses/types. This should be properly solved when implementing StrawberryScalar
|
157
156
|
def scalar(
|
158
|
-
cls=None,
|
157
|
+
cls: Optional[_T] = None,
|
159
158
|
*,
|
160
159
|
name: Optional[str] = None,
|
161
160
|
description: Optional[str] = None,
|
@@ -194,7 +193,7 @@ def scalar(
|
|
194
193
|
if parse_value is None:
|
195
194
|
parse_value = cls
|
196
195
|
|
197
|
-
def wrap(cls:
|
196
|
+
def wrap(cls: _T) -> ScalarWrapper:
|
198
197
|
return _process_scalar(
|
199
198
|
cls,
|
200
199
|
name=name,
|
@@ -21,7 +21,7 @@ def _convert_from_pydantic_to_strawberry_type(
|
|
21
21
|
type_: Union[StrawberryType, type],
|
22
22
|
data_from_model=None, # noqa: ANN001
|
23
23
|
extra=None, # noqa: ANN001
|
24
|
-
):
|
24
|
+
) -> Any:
|
25
25
|
data = data_from_model if data_from_model is not None else extra
|
26
26
|
|
27
27
|
if isinstance(type_, StrawberryOptional):
|
@@ -291,11 +291,11 @@ class GraphQLRouter(
|
|
291
291
|
websocket: WebSocket,
|
292
292
|
context: Context = Depends(self.context_getter),
|
293
293
|
root_value: RootValue = Depends(self.root_value_getter),
|
294
|
-
):
|
295
|
-
async def _get_context():
|
294
|
+
) -> None:
|
295
|
+
async def _get_context() -> Context:
|
296
296
|
return context
|
297
297
|
|
298
|
-
async def _get_root_value():
|
298
|
+
async def _get_root_value() -> RootValue:
|
299
299
|
return root_value
|
300
300
|
|
301
301
|
preferred_protocol = self.pick_preferred_protocol(websocket)
|
@@ -6,13 +6,12 @@ from typing import (
|
|
6
6
|
List,
|
7
7
|
NewType,
|
8
8
|
Optional,
|
9
|
-
Type,
|
10
9
|
TypeVar,
|
11
10
|
Union,
|
12
11
|
overload,
|
13
12
|
)
|
14
13
|
|
15
|
-
from strawberry.custom_scalar import _process_scalar
|
14
|
+
from strawberry.custom_scalar import ScalarWrapper, _process_scalar
|
16
15
|
|
17
16
|
# in python 3.10+ NewType is a class
|
18
17
|
if sys.version_info >= (3, 10):
|
@@ -63,7 +62,7 @@ def scalar(
|
|
63
62
|
|
64
63
|
|
65
64
|
def scalar(
|
66
|
-
cls=None,
|
65
|
+
cls: Optional[_T] = None,
|
67
66
|
*,
|
68
67
|
name: Optional[str] = None,
|
69
68
|
description: Optional[str] = None,
|
@@ -131,7 +130,7 @@ def scalar(
|
|
131
130
|
if tags:
|
132
131
|
directives.extend(Tag(name=tag) for tag in tags)
|
133
132
|
|
134
|
-
def wrap(cls:
|
133
|
+
def wrap(cls: _T) -> ScalarWrapper:
|
135
134
|
return _process_scalar(
|
136
135
|
cls,
|
137
136
|
name=name,
|
@@ -1,5 +1,4 @@
|
|
1
1
|
from collections import defaultdict
|
2
|
-
from copy import copy
|
3
2
|
from functools import cached_property, partial
|
4
3
|
from itertools import chain
|
5
4
|
from typing import (
|
@@ -10,6 +9,7 @@ from typing import (
|
|
10
9
|
Iterable,
|
11
10
|
List,
|
12
11
|
Mapping,
|
12
|
+
NewType,
|
13
13
|
Optional,
|
14
14
|
Set,
|
15
15
|
Type,
|
@@ -17,36 +17,36 @@ from typing import (
|
|
17
17
|
cast,
|
18
18
|
)
|
19
19
|
|
20
|
-
from graphql import
|
21
|
-
GraphQLError,
|
22
|
-
GraphQLField,
|
23
|
-
GraphQLInterfaceType,
|
24
|
-
GraphQLList,
|
25
|
-
GraphQLNonNull,
|
26
|
-
GraphQLScalarType,
|
27
|
-
GraphQLUnionType,
|
28
|
-
)
|
29
|
-
from graphql.type.definition import GraphQLArgument
|
20
|
+
from graphql import GraphQLError
|
30
21
|
|
22
|
+
from strawberry.annotation import StrawberryAnnotation
|
23
|
+
from strawberry.custom_scalar import scalar
|
31
24
|
from strawberry.printer import print_schema
|
32
25
|
from strawberry.schema import Schema as BaseSchema
|
26
|
+
from strawberry.type import (
|
27
|
+
StrawberryContainer,
|
28
|
+
WithStrawberryObjectDefinition,
|
29
|
+
get_object_definition,
|
30
|
+
)
|
31
|
+
from strawberry.types.info import Info
|
33
32
|
from strawberry.types.types import StrawberryObjectDefinition
|
33
|
+
from strawberry.union import StrawberryUnion
|
34
34
|
from strawberry.utils.inspect import get_func_args
|
35
35
|
|
36
36
|
from .schema_directive import StrawberryFederationSchemaDirective
|
37
37
|
|
38
38
|
if TYPE_CHECKING:
|
39
39
|
from graphql import ExecutionContext as GraphQLExecutionContext
|
40
|
-
from graphql import GraphQLObjectType
|
41
40
|
|
42
41
|
from strawberry.custom_scalar import ScalarDefinition, ScalarWrapper
|
43
42
|
from strawberry.enum import EnumDefinition
|
44
43
|
from strawberry.extensions import SchemaExtension
|
45
44
|
from strawberry.federation.schema_directives import ComposeDirective
|
46
45
|
from strawberry.schema.config import StrawberryConfig
|
47
|
-
from strawberry.schema.types.concrete_type import TypeMap
|
48
46
|
from strawberry.schema_directive import StrawberrySchemaDirective
|
49
|
-
|
47
|
+
|
48
|
+
|
49
|
+
FederationAny = scalar(NewType("_Any", object), name="_Any") # type: ignore
|
50
50
|
|
51
51
|
|
52
52
|
class Schema(BaseSchema):
|
@@ -67,7 +67,8 @@ class Schema(BaseSchema):
|
|
67
67
|
schema_directives: Iterable[object] = (),
|
68
68
|
enable_federation_2: bool = False,
|
69
69
|
) -> None:
|
70
|
-
query = self._get_federation_query_type(query)
|
70
|
+
query = self._get_federation_query_type(query, mutation, subscription, types)
|
71
|
+
types = [*types, FederationAny]
|
71
72
|
|
72
73
|
super().__init__(
|
73
74
|
query=query,
|
@@ -84,16 +85,19 @@ class Schema(BaseSchema):
|
|
84
85
|
|
85
86
|
self.schema_directives = list(schema_directives)
|
86
87
|
|
87
|
-
self._add_scalars()
|
88
|
-
self._add_entities_to_query()
|
89
|
-
|
90
88
|
if enable_federation_2:
|
91
89
|
composed_directives = self._add_compose_directives()
|
92
90
|
self._add_link_directives(composed_directives) # type: ignore
|
93
91
|
else:
|
94
92
|
self._remove_resolvable_field()
|
95
93
|
|
96
|
-
def _get_federation_query_type(
|
94
|
+
def _get_federation_query_type(
|
95
|
+
self,
|
96
|
+
query: Optional[Type[WithStrawberryObjectDefinition]],
|
97
|
+
mutation: Optional[Type[WithStrawberryObjectDefinition]],
|
98
|
+
subscription: Optional[Type[WithStrawberryObjectDefinition]],
|
99
|
+
additional_types: Iterable[Type[WithStrawberryObjectDefinition]],
|
100
|
+
) -> Type:
|
97
101
|
"""Returns a new query type that includes the _service field.
|
98
102
|
|
99
103
|
If the query type is provided, it will be used as the base for the new
|
@@ -109,13 +113,6 @@ class Schema(BaseSchema):
|
|
109
113
|
added if the schema contains an entity type.
|
110
114
|
"""
|
111
115
|
|
112
|
-
# note we don't add the _entities field here, as we need to know if the
|
113
|
-
# schema contains an entity type first and we do that by leveraging
|
114
|
-
# the schema converter type map, so we don't have to do that twice
|
115
|
-
# TODO: ideally we should be able to do this without using the schema
|
116
|
-
# converter, but for now this is the easiest way to do it
|
117
|
-
# see `_add_entities_to_query`
|
118
|
-
|
119
116
|
import strawberry
|
120
117
|
from strawberry.tools.create_type import create_type
|
121
118
|
from strawberry.tools.merge_types import merge_types
|
@@ -132,6 +129,19 @@ class Schema(BaseSchema):
|
|
132
129
|
|
133
130
|
fields = [service]
|
134
131
|
|
132
|
+
entity_type = _get_entity_type(query, mutation, subscription, additional_types)
|
133
|
+
|
134
|
+
if entity_type:
|
135
|
+
self.entities_resolver.__annotations__["return"] = List[
|
136
|
+
Optional[entity_type] # type: ignore
|
137
|
+
]
|
138
|
+
|
139
|
+
entities_field = strawberry.field(
|
140
|
+
name="_entities", resolver=self.entities_resolver
|
141
|
+
)
|
142
|
+
|
143
|
+
fields.insert(0, entities_field)
|
144
|
+
|
135
145
|
FederationQuery = create_type(name="Query", fields=fields)
|
136
146
|
|
137
147
|
if query is None:
|
@@ -139,10 +149,7 @@ class Schema(BaseSchema):
|
|
139
149
|
|
140
150
|
query_type = merge_types(
|
141
151
|
"Query",
|
142
|
-
(
|
143
|
-
FederationQuery,
|
144
|
-
query,
|
145
|
-
),
|
152
|
+
(FederationQuery, query),
|
146
153
|
)
|
147
154
|
|
148
155
|
# TODO: this should be probably done in merge_types
|
@@ -151,31 +158,9 @@ class Schema(BaseSchema):
|
|
151
158
|
|
152
159
|
return query_type
|
153
160
|
|
154
|
-
def _add_entities_to_query(self):
|
155
|
-
entity_type = _get_entity_type(self.schema_converter.type_map)
|
156
|
-
|
157
|
-
if not entity_type:
|
158
|
-
return
|
159
|
-
|
160
|
-
self._schema.type_map[entity_type.name] = entity_type
|
161
|
-
fields = {"_entities": self._get_entities_field(entity_type)}
|
162
|
-
|
163
|
-
# Copy the query type, update it to use the modified fields
|
164
|
-
query_type = cast("GraphQLObjectType", self._schema.query_type)
|
165
|
-
fields.update(query_type.fields)
|
166
|
-
|
167
|
-
query_type = copy(query_type)
|
168
|
-
query_type.fields = fields
|
169
|
-
|
170
|
-
self._schema.query_type = query_type
|
171
|
-
self._schema.type_map[query_type.name] = query_type
|
172
|
-
|
173
161
|
def entities_resolver(
|
174
|
-
self,
|
175
|
-
|
176
|
-
info, # noqa: ANN001
|
177
|
-
representations, # noqa: ANN001
|
178
|
-
) -> List[object]:
|
162
|
+
self, info: Info, representations: List[FederationAny]
|
163
|
+
) -> List[FederationAny]:
|
179
164
|
results = []
|
180
165
|
|
181
166
|
for representation in representations:
|
@@ -198,9 +183,8 @@ class Schema(BaseSchema):
|
|
198
183
|
else:
|
199
184
|
from strawberry.arguments import convert_argument
|
200
185
|
|
201
|
-
|
202
|
-
|
203
|
-
scalar_registry = strawberry_schema.schema_converter.scalar_registry
|
186
|
+
config = info.schema.config
|
187
|
+
scalar_registry = info.schema.schema_converter.scalar_registry
|
204
188
|
|
205
189
|
get_result = partial(
|
206
190
|
convert_argument,
|
@@ -222,11 +206,6 @@ class Schema(BaseSchema):
|
|
222
206
|
|
223
207
|
return results
|
224
208
|
|
225
|
-
def _add_scalars(self):
|
226
|
-
self.Any = GraphQLScalarType("_Any")
|
227
|
-
|
228
|
-
self._schema.type_map["_Any"] = self.Any
|
229
|
-
|
230
209
|
def _remove_resolvable_field(self) -> None:
|
231
210
|
# this might be removed when we remove support for federation 1
|
232
211
|
# or when we improve how we print the directives
|
@@ -283,7 +262,7 @@ class Schema(BaseSchema):
|
|
283
262
|
|
284
263
|
def _add_link_directives(
|
285
264
|
self, additional_directives: Optional[List[object]] = None
|
286
|
-
):
|
265
|
+
) -> None:
|
287
266
|
from .schema_directives import FederationDirective, Link
|
288
267
|
|
289
268
|
directive_by_url: DefaultDict[str, Set[str]] = defaultdict(set)
|
@@ -335,17 +314,6 @@ class Schema(BaseSchema):
|
|
335
314
|
|
336
315
|
return compose_directives
|
337
316
|
|
338
|
-
def _get_entities_field(self, entity_type: GraphQLUnionType) -> GraphQLField:
|
339
|
-
return GraphQLField(
|
340
|
-
GraphQLNonNull(GraphQLList(entity_type)),
|
341
|
-
args={
|
342
|
-
"representations": GraphQLArgument(
|
343
|
-
GraphQLNonNull(GraphQLList(GraphQLNonNull(self.Any)))
|
344
|
-
)
|
345
|
-
},
|
346
|
-
resolve=self.entities_resolver,
|
347
|
-
)
|
348
|
-
|
349
317
|
def _warn_for_federation_directives(self) -> None:
|
350
318
|
# this is used in the main schema to raise if there's a directive
|
351
319
|
# that's for federation, but in this class we don't want to warn,
|
@@ -354,33 +322,56 @@ class Schema(BaseSchema):
|
|
354
322
|
pass
|
355
323
|
|
356
324
|
|
357
|
-
def _get_entity_type(
|
358
|
-
|
325
|
+
def _get_entity_type(
|
326
|
+
query: Optional[Type[WithStrawberryObjectDefinition]],
|
327
|
+
mutation: Optional[Type[WithStrawberryObjectDefinition]],
|
328
|
+
subscription: Optional[Type[WithStrawberryObjectDefinition]],
|
329
|
+
additional_types: Iterable[Type[WithStrawberryObjectDefinition]],
|
330
|
+
) -> Optional[StrawberryUnion]:
|
331
|
+
# recursively iterate over the schema to find all types annotated with @key
|
332
|
+
# if no types are annotated with @key, then the _Entity union and Query._entities
|
333
|
+
# field should not be added to the schema
|
359
334
|
|
360
|
-
|
361
|
-
# should be added to the _Entity union.
|
335
|
+
entity_types = set()
|
362
336
|
|
363
|
-
|
364
|
-
|
365
|
-
for type in type_map.values()
|
366
|
-
if _has_federation_keys(type.definition)
|
367
|
-
# TODO: check this
|
368
|
-
and not isinstance(type.implementation, GraphQLInterfaceType)
|
369
|
-
]
|
337
|
+
# need a stack to keep track of the types we need to visit
|
338
|
+
stack: List[Any] = [query, mutation, subscription, *additional_types]
|
370
339
|
|
371
|
-
|
372
|
-
# union and Query._entities field should be removed from the schema.
|
373
|
-
if not federation_key_types:
|
374
|
-
return None
|
340
|
+
seen = set()
|
375
341
|
|
376
|
-
|
342
|
+
while stack:
|
343
|
+
type_ = stack.pop()
|
377
344
|
|
378
|
-
|
379
|
-
|
345
|
+
if type_ is None:
|
346
|
+
continue
|
347
|
+
|
348
|
+
while isinstance(type_, StrawberryContainer):
|
349
|
+
type_ = type_.of_type
|
350
|
+
|
351
|
+
type_definition = get_object_definition(type_, strict=False)
|
352
|
+
|
353
|
+
if type_definition is None:
|
354
|
+
continue
|
355
|
+
|
356
|
+
if type_definition.is_object_type and _has_federation_keys(type_definition):
|
357
|
+
entity_types.add(type_)
|
358
|
+
|
359
|
+
for field in type_definition.fields:
|
360
|
+
if field.type and field.type in seen:
|
361
|
+
continue
|
362
|
+
|
363
|
+
seen.add(field.type)
|
364
|
+
stack.append(field.type)
|
365
|
+
|
366
|
+
if not entity_types:
|
367
|
+
return None
|
380
368
|
|
381
|
-
|
369
|
+
sorted_types = sorted(entity_types, key=lambda t: t.__strawberry_definition__.name)
|
382
370
|
|
383
|
-
return
|
371
|
+
return StrawberryUnion(
|
372
|
+
"_Entity",
|
373
|
+
type_annotations=tuple(StrawberryAnnotation(type_) for type_ in sorted_types),
|
374
|
+
)
|
384
375
|
|
385
376
|
|
386
377
|
def _is_key(directive: Any) -> bool:
|
{strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/federation/schema_directive.py
RENAMED
@@ -38,7 +38,7 @@ def schema_directive(
|
|
38
38
|
import_url: Optional[str] = None,
|
39
39
|
) -> Callable[..., T]:
|
40
40
|
def _wrap(cls: T) -> T:
|
41
|
-
cls = _wrap_dataclass(cls)
|
41
|
+
cls = _wrap_dataclass(cls) # type: ignore
|
42
42
|
fields = _get_fields(cls, {})
|
43
43
|
|
44
44
|
cls.__strawberry_directive__ = StrawberryFederationSchemaDirective(
|
@@ -44,7 +44,7 @@ def _get_interfaces(cls: Type[Any]) -> List[StrawberryObjectDefinition]:
|
|
44
44
|
return interfaces
|
45
45
|
|
46
46
|
|
47
|
-
def _check_field_annotations(cls: Type[Any]):
|
47
|
+
def _check_field_annotations(cls: Type[Any]) -> None:
|
48
48
|
"""Are any of the dataclass Fields missing type annotations?
|
49
49
|
|
50
50
|
This is similar to the check that dataclasses do during creation, but allows us to
|
@@ -102,7 +102,7 @@ def _check_field_annotations(cls: Type[Any]):
|
|
102
102
|
raise MissingFieldAnnotationError(field_name, cls)
|
103
103
|
|
104
104
|
|
105
|
-
def _wrap_dataclass(cls: Type[
|
105
|
+
def _wrap_dataclass(cls: Type[T]) -> Type[T]:
|
106
106
|
"""Wrap a strawberry.type class with a dataclass and check for any issues
|
107
107
|
before doing so"""
|
108
108
|
|
@@ -239,7 +239,7 @@ def type(
|
|
239
239
|
>>> field_abc: str = "ABC"
|
240
240
|
"""
|
241
241
|
|
242
|
-
def wrap(cls:
|
242
|
+
def wrap(cls: T) -> T:
|
243
243
|
if not inspect.isclass(cls):
|
244
244
|
if is_input:
|
245
245
|
exc = ObjectIsNotClassError.input
|
@@ -268,7 +268,7 @@ def type(
|
|
268
268
|
|
269
269
|
wrapped = _wrap_dataclass(cls)
|
270
270
|
|
271
|
-
return _process_type(
|
271
|
+
return _process_type( # type: ignore
|
272
272
|
wrapped,
|
273
273
|
name=name,
|
274
274
|
is_input=is_input,
|
@@ -566,7 +566,7 @@ def print_schema(schema: BaseSchema) -> str:
|
|
566
566
|
None, [print_directive(directive, schema=schema) for directive in directives]
|
567
567
|
)
|
568
568
|
|
569
|
-
def _name_getter(type_: Any):
|
569
|
+
def _name_getter(type_: Any) -> str:
|
570
570
|
if hasattr(type_, "name"):
|
571
571
|
return type_.name
|
572
572
|
if isinstance(type_, ScalarWrapper):
|
@@ -9,6 +9,7 @@ from typing import (
|
|
9
9
|
TYPE_CHECKING,
|
10
10
|
Any,
|
11
11
|
AsyncIterator,
|
12
|
+
Awaitable,
|
12
13
|
Callable,
|
13
14
|
DefaultDict,
|
14
15
|
Dict,
|
@@ -35,6 +36,7 @@ from strawberry.extensions.field_extension import (
|
|
35
36
|
SyncExtensionResolver,
|
36
37
|
)
|
37
38
|
from strawberry.field import _RESOLVER_TYPE, StrawberryField, field
|
39
|
+
from strawberry.lazy_type import LazyType
|
38
40
|
from strawberry.relay.exceptions import (
|
39
41
|
RelayWrongAnnotationError,
|
40
42
|
RelayWrongResolverAnnotationError,
|
@@ -42,7 +44,7 @@ from strawberry.relay.exceptions import (
|
|
42
44
|
from strawberry.type import StrawberryList, StrawberryOptional
|
43
45
|
from strawberry.types.fields.resolver import StrawberryResolver
|
44
46
|
from strawberry.utils.aio import asyncgen_to_list
|
45
|
-
from strawberry.utils.typing import eval_type
|
47
|
+
from strawberry.utils.typing import eval_type, is_generic_alias
|
46
48
|
|
47
49
|
from .types import Connection, GlobalID, Node, NodeIterableType, NodeType
|
48
50
|
|
@@ -86,7 +88,7 @@ class NodeExtension(FieldExtension):
|
|
86
88
|
def resolver(
|
87
89
|
info: Info,
|
88
90
|
id: Annotated[GlobalID, argument(description="The ID of the object.")],
|
89
|
-
):
|
91
|
+
) -> Union[Node, None, Awaitable[Union[Node, None]]]:
|
90
92
|
return id.resolve_type(info).resolve_node(
|
91
93
|
id.node_id,
|
92
94
|
info=info,
|
@@ -105,7 +107,7 @@ class NodeExtension(FieldExtension):
|
|
105
107
|
ids: Annotated[
|
106
108
|
List[GlobalID], argument(description="The IDs of the objects.")
|
107
109
|
],
|
108
|
-
):
|
110
|
+
) -> Union[List[Node], Awaitable[List[Node]]]:
|
109
111
|
nodes_map: DefaultDict[Type[Node], List[str]] = defaultdict(list)
|
110
112
|
# Store the index of the node in the list of nodes of the same type
|
111
113
|
# so that we can return them in the same order while also supporting
|
@@ -138,7 +140,7 @@ class NodeExtension(FieldExtension):
|
|
138
140
|
|
139
141
|
if awaitable_nodes or asyncgen_nodes:
|
140
142
|
|
141
|
-
async def resolve(resolved=resolved_nodes)
|
143
|
+
async def resolve(resolved: Any = resolved_nodes) -> List[Node]:
|
142
144
|
resolved.update(
|
143
145
|
zip(
|
144
146
|
[
|
@@ -222,7 +224,13 @@ class ConnectionExtension(FieldExtension):
|
|
222
224
|
]
|
223
225
|
|
224
226
|
f_type = field.type
|
225
|
-
|
227
|
+
|
228
|
+
if isinstance(f_type, LazyType):
|
229
|
+
f_type = f_type.resolve_type()
|
230
|
+
field.type = f_type
|
231
|
+
|
232
|
+
type_origin = get_origin(f_type) if is_generic_alias(f_type) else f_type
|
233
|
+
if not isinstance(type_origin, type) or not issubclass(type_origin, Connection):
|
226
234
|
raise RelayWrongAnnotationError(field.name, cast(type, field.origin))
|
227
235
|
|
228
236
|
assert field.base_resolver
|
@@ -859,7 +859,7 @@ class ListConnection(Connection[NodeType]):
|
|
859
859
|
|
860
860
|
if isinstance(nodes, (AsyncIterator, AsyncIterable)) and in_async_context():
|
861
861
|
|
862
|
-
async def resolver():
|
862
|
+
async def resolver() -> Self:
|
863
863
|
try:
|
864
864
|
iterator = cast(
|
865
865
|
Union[AsyncIterator[NodeType], AsyncIterable[NodeType]],
|
@@ -324,7 +324,7 @@ class Schema(BaseSchema):
|
|
324
324
|
operation_name=operation_name,
|
325
325
|
)
|
326
326
|
|
327
|
-
def _resolve_node_ids(self):
|
327
|
+
def _resolve_node_ids(self) -> None:
|
328
328
|
for concrete_type in self.schema_converter.type_map.values():
|
329
329
|
type_def = concrete_type.definition
|
330
330
|
|
@@ -355,7 +355,7 @@ class Schema(BaseSchema):
|
|
355
355
|
if not has_custom_resolve_id:
|
356
356
|
origin.resolve_id_attr()
|
357
357
|
|
358
|
-
def _warn_for_federation_directives(self):
|
358
|
+
def _warn_for_federation_directives(self) -> None:
|
359
359
|
"""Raises a warning if the schema has any federation directives."""
|
360
360
|
from strawberry.federation.schema_directives import FederationDirective
|
361
361
|
|
@@ -378,7 +378,7 @@ class Schema(BaseSchema):
|
|
378
378
|
stacklevel=3,
|
379
379
|
)
|
380
380
|
|
381
|
-
def _extend_introspection(self):
|
381
|
+
def _extend_introspection(self) -> None:
|
382
382
|
def _resolve_is_one_of(obj: Any, info: Any) -> bool:
|
383
383
|
return obj.extensions["strawberry-definition"].is_one_of
|
384
384
|
|
{strawberry_graphql-0.232.1 → strawberry_graphql-0.233.0}/strawberry/schema/schema_converter.py
RENAMED
@@ -462,7 +462,12 @@ class GraphQLCoreConverter:
|
|
462
462
|
assert isinstance(graphql_interface, GraphQLInterfaceType) # For mypy
|
463
463
|
return graphql_interface
|
464
464
|
|
465
|
-
def _get_resolve_type()
|
465
|
+
def _get_resolve_type() -> (
|
466
|
+
Callable[
|
467
|
+
[Any, GraphQLResolveInfo, GraphQLAbstractType],
|
468
|
+
Union[Awaitable[Optional[str]], str, None],
|
469
|
+
]
|
470
|
+
):
|
466
471
|
if interface.resolve_type:
|
467
472
|
return interface.resolve_type
|
468
473
|
|
@@ -594,7 +599,7 @@ class GraphQLCoreConverter:
|
|
594
599
|
|
595
600
|
if field.is_basic_field:
|
596
601
|
|
597
|
-
def _get_basic_result(_source: Any, *args: str, **kwargs: Any):
|
602
|
+
def _get_basic_result(_source: Any, *args: str, **kwargs: Any) -> Any:
|
598
603
|
# Call `get_result` without an info object or any args or
|
599
604
|
# kwargs because this is a basic field with no resolver.
|
600
605
|
return field.get_result(_source, info=None, args=[], kwargs={})
|
@@ -664,7 +669,7 @@ class GraphQLCoreConverter:
|
|
664
669
|
info: Info,
|
665
670
|
field_args: List[Any],
|
666
671
|
field_kwargs: Dict[str, Any],
|
667
|
-
):
|
672
|
+
) -> Any:
|
668
673
|
return field.get_result(
|
669
674
|
_source, info=info, args=field_args, kwargs=field_kwargs
|
670
675
|
)
|
@@ -681,7 +686,7 @@ class GraphQLCoreConverter:
|
|
681
686
|
_source: Any,
|
682
687
|
info: Info,
|
683
688
|
**kwargs: Any,
|
684
|
-
):
|
689
|
+
) -> Any:
|
685
690
|
# parse field arguments into Strawberry input types and convert
|
686
691
|
# field names to Python equivalents
|
687
692
|
field_args, field_kwargs = _get_arguments(
|
@@ -698,7 +703,7 @@ class GraphQLCoreConverter:
|
|
698
703
|
# `_get_result` expects `field_args` and `field_kwargs` as
|
699
704
|
# separate arguments so we have to wrap the function so that we
|
700
705
|
# can pass them in
|
701
|
-
def wrapped_get_result(_source: Any, info: Info, **kwargs: Any):
|
706
|
+
def wrapped_get_result(_source: Any, info: Info, **kwargs: Any) -> Any:
|
702
707
|
# if the resolver function requested the info object info
|
703
708
|
# then put it back in the kwargs dictionary
|
704
709
|
if resolver_requested_info:
|
@@ -719,7 +724,7 @@ class GraphQLCoreConverter:
|
|
719
724
|
|
720
725
|
_get_result_with_extensions = wrap_field_extensions()
|
721
726
|
|
722
|
-
def _resolver(_source: Any, info: GraphQLResolveInfo, **kwargs: Any):
|
727
|
+
def _resolver(_source: Any, info: GraphQLResolveInfo, **kwargs: Any) -> Any:
|
723
728
|
strawberry_info = _strawberry_info_from_graphql(info)
|
724
729
|
|
725
730
|
return _get_result_with_extensions(
|
@@ -730,7 +735,7 @@ class GraphQLCoreConverter:
|
|
730
735
|
|
731
736
|
async def _async_resolver(
|
732
737
|
_source: Any, info: GraphQLResolveInfo, **kwargs: Any
|
733
|
-
):
|
738
|
+
) -> Any:
|
734
739
|
strawberry_info = _strawberry_info_from_graphql(info)
|
735
740
|
|
736
741
|
return await await_maybe(
|
@@ -53,7 +53,7 @@ def schema_directive(
|
|
53
53
|
print_definition: bool = True,
|
54
54
|
) -> Callable[..., T]:
|
55
55
|
def _wrap(cls: T) -> T:
|
56
|
-
cls = _wrap_dataclass(cls)
|
56
|
+
cls = _wrap_dataclass(cls) # type: ignore
|
57
57
|
fields = _get_fields(cls, {})
|
58
58
|
|
59
59
|
cls.__strawberry_directive__ = StrawberrySchemaDirective(
|