Skip to content

Commit

Permalink
feat: support for strawberry 0.212.0+ (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 authored Nov 7, 2023
1 parent 8cccadf commit 7a55004
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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

0 comments on commit 7a55004

Please # to comment.