Skip to content

Commit

Permalink
Add _meta explicitely
Browse files Browse the repository at this point in the history
  • Loading branch information
that-one-arab committed Nov 9, 2024
1 parent e028a7d commit 1406b8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions graphene/types/union.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ class Query(ObjectType):
"""

@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)

Expand Down

0 comments on commit 1406b8f

Please sign in to comment.