From 1406b8f9609b142a7a6575badbfb2380327f7d47 Mon Sep 17 00:00:00 2001 From: Muhammed Aldulaimi Date: Sat, 9 Nov 2024 13:00:17 +0300 Subject: [PATCH] Add _meta explicitely --- graphene/types/union.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graphene/types/union.py b/graphene/types/union.py index 277ed794..809ed01b 100644 --- a/graphene/types/union.py +++ b/graphene/types/union.py @@ -51,12 +51,14 @@ class Union(UnmountedType, BaseType): """ @classmethod - def __init_subclass_with_meta__(cls, types=None, **options): + def __init_subclass_with_meta__(cls, types=None, _meta=None, **options): assert ( isinstance(types, (list, tuple)) and len(types) > 0 ), f"Must provide types for Union {cls.__name__}." - _meta = options.pop("_meta", UnionOptions(cls)) + if _meta is None: + _meta = UnionOptions(cls) + _meta.types = types super(Union, cls).__init_subclass_with_meta__(_meta=_meta, **options)