Skip to content

Commit a353b4f

Browse files
committed
fix(field): prevent early ImportError on Field.type to break
`field.type` gets accessed earlier while there's still a change for a circular import to happen, which leads to an `ImportError` During that period it is ok (and correct) to return `UNRESOLVED` If that also happens later, `UNRESOLVED` will still raise an error while creating the schema itself. Fix #779
1 parent f228320 commit a353b4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

strawberry_django/fields/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def resolve_type(
193193

194194
try:
195195
resolved_django_type = get_django_definition(unwrap_type(resolved))
196-
except KeyError:
196+
except (KeyError, ImportError):
197197
return UNRESOLVED
198198

199199
if self.origin_django_type and (

0 commit comments

Comments
 (0)