Skip to content

Commit 1fdf001

Browse files
committed
fix: is_type_of objecttype
1 parent 9ee1620 commit 1fdf001

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

graphene_pydantic/objecttype.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from graphql import GraphQLResolveInfo
88

99
from .converters import convert_pydantic_field
10+
from .inputobjecttype import PydanticInputObjectType
1011
from .registry import Placeholder, Registry, get_global_registry
1112

1213

@@ -158,4 +159,6 @@ def resolve_placeholders(cls):
158159

159160
@classmethod
160161
def is_type_of(cls, root, _: GraphQLResolveInfo) -> bool:
161-
return root.__annotations__ == cls._meta.model.__annotations__
162+
if isinstance(root, PydanticInputObjectType):
163+
return type(root._meta.model) is type(cls._meta.model)
164+
return isinstance(root, cls._meta.model)

poetry.lock

Lines changed: 51 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)