2424 UUID ,
2525 Union ,
2626)
27+ from graphene .types .base import BaseType
2728from graphene .types .datetime import Date , DateTime , Time
2829from pydantic import BaseModel
2930from pydantic .fields import FieldInfo
3031from pydantic_core import PydanticUndefined
3132
32- from .registry import Registry
33+ from .registry import Placeholder , Registry
3334from .util import construct_union_class_name , evaluate_forward_ref
3435
3536PYTHON10 = sys .version_info >= (3 , 10 )
@@ -175,7 +176,7 @@ def convert_pydantic_type(
175176 registry : Registry ,
176177 parent_type : T .Type = None ,
177178 model : T .Type [BaseModel ] = None ,
178- ) -> Type : # noqa: C901
179+ ) -> T . Union [ Type [ T . Union [ BaseType , List ]], Placeholder ] : # noqa: C901
179180 """
180181 Convert a Pydantic type to a Graphene Field type, including not just the
181182 native Python type but any additional metadata (e.g. shape) that Pydantic
@@ -197,7 +198,7 @@ def find_graphene_type(
197198 registry : Registry ,
198199 parent_type : T .Type = None ,
199200 model : T .Type [BaseModel ] = None ,
200- ) -> Type : # noqa: C901
201+ ) -> T . Union [ Type [ T . Union [ BaseType , List ]], Placeholder ] : # noqa: C901
201202 """
202203 Map a native Python type to a Graphene-supported Field type, where possible,
203204 throwing an error if we don't know what to map it to.
@@ -303,10 +304,10 @@ def convert_generic_python_type(
303304 registry : Registry ,
304305 parent_type : T .Type = None ,
305306 model : T .Type [BaseModel ] = None ,
306- ) -> Type : # noqa: C901
307+ ) -> T . Union [ Type [ T . Union [ BaseType , List ]], Placeholder ] : # noqa: C901
307308 """
308309 Convert annotated Python generic types into the most appropriate Graphene
309- Field type -- e.g. turn `typing.Union` into a Graphene Union.
310+ Field type -- e.g., turn `typing.Union` into a Graphene Union.
310311 """
311312 origin = type_ .__origin__
312313 if not origin : # pragma: no cover # this really should be impossible
@@ -393,7 +394,7 @@ def convert_literal_type(
393394 registry : Registry ,
394395 parent_type : T .Type = None ,
395396 model : T .Type [BaseModel ] = None ,
396- ):
397+ ) -> T . Union [ Type [ T . Union [ BaseType , List ]], Placeholder ] :
397398 """
398399 Convert an annotated Python Literal type into a Graphene Scalar or Union of Scalars.
399400 """
0 commit comments