Skip to content

Commit d112cc5

Browse files
authored
Merge pull request #297 from sjhewitt/connection-node
relay Connection.node does not have to subclass Node/ObjectType
2 parents f955280 + a77b279 commit d112cc5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

graphene/relay/connection.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66

77
from graphql_relay import connection_from_list
88

9-
from ..types import AbstractType, Boolean, Int, List, String
9+
from ..types import (AbstractType, Boolean, Enum, Int, Interface, List, NonNull, Scalar, String,
10+
Union)
1011
from ..types.field import Field
1112
from ..types.objecttype import ObjectType, ObjectTypeMeta
1213
from ..types.options import Options
1314
from ..utils.is_base_type import is_base_type
1415
from ..utils.props import props
15-
from .node import Node, is_node
16+
from .node import is_node
1617

1718

1819
class PageInfo(ObjectType):
@@ -57,7 +58,7 @@ def __new__(cls, name, bases, attrs):
5758
options.local_fields = OrderedDict()
5859

5960
assert options.node, 'You have to provide a node in {}.Meta'.format(cls.__name__)
60-
assert issubclass(options.node, (Node, ObjectType)), (
61+
assert issubclass(options.node, (Scalar, Enum, ObjectType, Interface, Union, NonNull)), (
6162
'Received incompatible node "{}" for Connection {}.'
6263
).format(options.node, name)
6364

0 commit comments

Comments
 (0)