We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a59aa31 commit e163bd7Copy full SHA for e163bd7
graphene_pydantic/converters.py
@@ -2,6 +2,7 @@
2
import collections.abc
3
import datetime
4
import decimal
5
+import inspect
6
import enum
7
import sys
8
import typing as T
@@ -199,7 +200,10 @@ def find_graphene_type(
199
200
return List
201
elif registry and registry.get_type_for_model(type_):
202
return registry.get_type_for_model(type_)
- elif registry and isinstance(type_, BaseModel):
203
+ elif registry and (
204
+ isinstance(type_, BaseModel)
205
+ or (inspect.isclass(type_) and issubclass(type_, BaseModel))
206
+ ):
207
# If it's a Pydantic model that hasn't yet been wrapped with a ObjectType,
208
# we can put a placeholder in and request that `resolve_placeholders()`
209
# be called to update it.
0 commit comments