Closed process0 closed 2 years ago
I believe this is a bug.
Currently, when running find_graphene_type with a Pydantic BaseModel, it will return None, which breaks in graphene/graphql with
find_graphene_type
BaseModel
None
TypeError: MODEL fields cannot be resolved. Expected Graphene type, but received: None.
The change proposes returning the Placeholder object instead of None.
Placeholder
I chose to recall the function, but we could equally do return registry.get_type_for_model(type_).
return registry.get_type_for_model(type_)
Return Placeholder when resolving graphene type
I believe this is a bug.
Currently, when running
find_graphene_type
with a PydanticBaseModel
, it will returnNone
, which breaks in graphene/graphql withTypeError: MODEL fields cannot be resolved. Expected Graphene type, but received: None.
The change proposes returning the
Placeholder
object instead ofNone
.I chose to recall the function, but we could equally do
return registry.get_type_for_model(type_)
.