We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ccae736 commit 3ed7bf6Copy full SHA for 3ed7bf6
graphene/types/union.py
@@ -51,12 +51,14 @@ class Query(ObjectType):
51
"""
52
53
@classmethod
54
- def __init_subclass_with_meta__(cls, types=None, **options):
+ def __init_subclass_with_meta__(cls, types=None, _meta=None, **options):
55
assert (
56
isinstance(types, (list, tuple)) and len(types) > 0
57
), f"Must provide types for Union {cls.__name__}."
58
59
- _meta = UnionOptions(cls)
+ if not _meta:
60
+ _meta = UnionOptions(cls)
61
+
62
_meta.types = types
63
super(Union, cls).__init_subclass_with_meta__(_meta=_meta, **options)
64
0 commit comments