Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: support for strawberry 0.212.0+ #410

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ classifiers = [
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
Django = ">=3.2"
strawberry-graphql = ">=0.209.4"
strawberry-graphql = ">=0.212.0"
django-debug-toolbar = { version = ">=3.4", optional = true }
django-choices-field = { version = ">=2.2.2", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions strawberry_django/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _process_type(
type_def = get_object_definition(cls, strict=True)
description_from_doc = settings["FIELD_DESCRIPTION_FROM_HELP_TEXT"]
new_fields: List[StrawberryField] = []
for f in type_def._fields:
for f in type_def.fields:
django_name: Optional[str] = (
getattr(f, "django_name", None) or f.python_name or f.name
)
Expand Down Expand Up @@ -389,7 +389,7 @@ def _process_type(
if f.base_resolver and f.python_name:
setattr(cls, f.python_name, f)

type_def._fields = new_fields
type_def.fields = new_fields
cls.__strawberry_django_definition__ = django_type # type: ignore
# TODO: remove when deprecating _type_definition
DeprecatedDescriptor(
Expand Down