|
14 | 14 | convert_sqlalchemy_relationship, |
15 | 15 | convert_sqlalchemy_hybrid_method) |
16 | 16 | from .registry import Registry, get_global_registry |
17 | | -from .utils import get_query, is_mapped |
| 17 | +from .utils import get_query, is_mapped_class, is_mapped_instance |
18 | 18 |
|
19 | 19 |
|
20 | 20 | def construct_fields(model, registry, only_fields, exclude_fields): |
@@ -90,7 +90,7 @@ class SQLAlchemyObjectType(ObjectType): |
90 | 90 | def __init_subclass_with_meta__(cls, model=None, registry=None, skip_registry=False, |
91 | 91 | only_fields=(), exclude_fields=(), connection=None, |
92 | 92 | use_connection=None, interfaces=(), id=None, **options): |
93 | | - assert is_mapped(model), ( |
| 93 | + assert is_mapped_class(model), ( |
94 | 94 | 'You need to pass a valid SQLAlchemy Model in ' |
95 | 95 | '{}.Meta, received "{}".' |
96 | 96 | ).format(cls.__name__, model) |
@@ -136,7 +136,7 @@ def __init_subclass_with_meta__(cls, model=None, registry=None, skip_registry=Fa |
136 | 136 | def is_type_of(cls, root, context, info): |
137 | 137 | if isinstance(root, cls): |
138 | 138 | return True |
139 | | - if not is_mapped(type(root)): |
| 139 | + if not is_mapped_instance(root): |
140 | 140 | raise Exception(( |
141 | 141 | 'Received incompatible instance "{}".' |
142 | 142 | ).format(root)) |
|
0 commit comments