Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit b5b0141

Browse files
committed
fix: also support auto when checking for auto annotations
1 parent 16922ab commit b5b0141

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

strawberry_django_plus/utils/typing.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121

2222
def is_auto(type_: Any) -> bool:
23-
try:
24-
return isinstance(type_, StrawberryAuto)
25-
except NameError:
26-
# This is to support "from __future__ import annotations" cases
27-
return type_ == "strawberry.auto" or type_ == "gql.auto"
23+
if isinstance(type_, str):
24+
return type_ in ["strawberry.auto", "gql.auto", "auto"]
25+
26+
return isinstance(type_, StrawberryAuto)

0 commit comments

Comments
 (0)