Skip to content

Commit 3ed7bf6

Browse files
chore: Make Union meta overridable (#1583)
This PR makes the Union Options configurable, similar to how it works with ObjectTypes --------- Co-authored-by: Erik Wrede <erikwrede@users.noreply.github.com>
1 parent ccae736 commit 3ed7bf6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graphene/types/union.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ class Query(ObjectType):
5151
"""
5252

5353
@classmethod
54-
def __init_subclass_with_meta__(cls, types=None, **options):
54+
def __init_subclass_with_meta__(cls, types=None, _meta=None, **options):
5555
assert (
5656
isinstance(types, (list, tuple)) and len(types) > 0
5757
), f"Must provide types for Union {cls.__name__}."
5858

59-
_meta = UnionOptions(cls)
59+
if not _meta:
60+
_meta = UnionOptions(cls)
61+
6062
_meta.types = types
6163
super(Union, cls).__init_subclass_with_meta__(_meta=_meta, **options)
6264

0 commit comments

Comments
 (0)