From 0328b86e2a0c99ce83e75e09739fd0816d0c2efc Mon Sep 17 00:00:00 2001 From: Muhammed Aldulaimi Date: Sun, 10 Nov 2024 07:46:03 +0300 Subject: [PATCH] Add UnionOptions to DjangoUnionTypeOptions inheritance list this change makes things more consistent and prevent possible issues with 3rd party libraries --- graphene_django/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphene_django/types.py b/graphene_django/types.py index 509991c..329ecf9 100644 --- a/graphene_django/types.py +++ b/graphene_django/types.py @@ -7,7 +7,7 @@ from django.db.models import Model # noqa: F401 import graphene from graphene.relay import Connection, Node from graphene.types.objecttype import ObjectType, ObjectTypeOptions -from graphene.types.union import Union +from graphene.types.union import Union, UnionOptions from graphene.types.utils import yank_fields_from_attrs from .converter import convert_django_field_with_choices @@ -294,7 +294,7 @@ class DjangoObjectType(ObjectType): return None -class DjangoUnionTypeOptions(ObjectTypeOptions): +class DjangoUnionTypeOptions(UnionOptions, ObjectTypeOptions): model = None # type: Type[Model] registry = None # type: Registry connection = None # type: Type[Connection]