Skip to content

Commit e2ec336

Browse files
committed
Ensure forward refs are evaluated correctly with Python >3.8
1 parent 9aaf1c6 commit e2ec336

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graphene_pydantic/converters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from graphene.types.datetime import Date, DateTime, Time
2525
from pydantic import BaseModel
2626
from pydantic.fields import ModelField
27+
from pydantic.typing import evaluate_forwardref
2728

2829
from .registry import Registry
2930
from .util import construct_union_class_name
@@ -227,7 +228,7 @@ def find_graphene_type(
227228
"See the README for more on forward references."
228229
)
229230
module_ns = sys.modules[sibling.__module__].__dict__
230-
resolved = type_._evaluate(module_ns, None)
231+
resolved = evaluate_forwardref(type_, module_ns, None)
231232
# TODO: make this behavior optional. maybe this is a place for the TypeOptions to play a role?
232233
if registry:
233234
registry.add_placeholder_for_model(resolved)

0 commit comments

Comments
 (0)