|
1 | | -from collections import OrderedDict |
2 | | -from functools import partial |
3 | | -from graphql.core.type import GraphQLObjectType |
4 | | -from graphql.core.type.definition import GraphQLInterfaceType, GraphQLUnionType |
5 | | -from ..utils.get_declared_fields import get_declared_fields |
6 | | -from ..utils.make_default_resolver import make_default_resolver |
| 1 | +from graphql.core.type.definition import GraphQLUnionType |
| 2 | + |
7 | 3 | from ..utils.no_implementation_registration import no_implementation_registration |
8 | | -from ..utils.weak_ref_holder import WeakRefHolder |
9 | | -from ..utils.yank_potential_fields import yank_potential_fields |
10 | 4 |
|
11 | 5 |
|
12 | | -class ObjectTypeMeta(type): |
| 6 | +class UnionMeta(type): |
13 | 7 | def __new__(mcs, name, bases, attrs): |
14 | 8 | if attrs.pop('abstract', False): |
15 | | - return super(ObjectTypeMeta, mcs).__new__(mcs, name, bases, attrs) |
| 9 | + return super(UnionMeta, mcs).__new__(mcs, name, bases, attrs) |
16 | 10 |
|
17 | 11 | with no_implementation_registration(): |
18 | 12 | union_type = GraphQLUnionType( |
19 | 13 | name, |
20 | | - types=mcs._get_types() |
| 14 | + types=mcs._get_types(), |
21 | 15 | description=attrs.get('__doc__'), |
22 | 16 | ) |
23 | 17 |
|
24 | 18 | mcs._register(union_type) |
25 | | - cls = super(ObjectTypeMeta, mcs).__new__(mcs, name, bases, attrs) |
| 19 | + cls = super(UnionMeta, mcs).__new__(mcs, name, bases, attrs) |
26 | 20 | cls.T = union_type |
27 | 21 | cls._registry = mcs._get_registry() |
28 | 22 |
|
|
0 commit comments