From 7b9611420267fc87e3f531aa7532c6a75ef948ef Mon Sep 17 00:00:00 2001 From: Paul Craciunoiu Date: Thu, 23 Apr 2020 15:25:36 -0600 Subject: [PATCH] Don't unwrap lazy user, instead check its class. --- graphene_django/types.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/graphene_django/types.py b/graphene_django/types.py index 0c0cb1c..d897986 100644 --- a/graphene_django/types.py +++ b/graphene_django/types.py @@ -268,12 +268,9 @@ class DjangoObjectType(ObjectType): @classmethod def is_type_of(cls, root, info): - if isinstance(root, SimpleLazyObject): - root._setup() - root = root._wrapped if isinstance(root, cls): return True - if not is_valid_django_model(type(root)): + if not is_valid_django_model(type(root.__class__)): raise Exception(('Received incompatible instance "{}".').format(root)) if cls._meta.model._meta.proxy: