From 87634240c9da458c2eaa438289939017bbd64924 Mon Sep 17 00:00:00 2001 From: Simon Hewitt Date: Wed, 31 Aug 2016 15:03:51 -0700 Subject: [PATCH 1/2] relay Connection.node does not have to subclass Node/ObjectType --- graphene/relay/connection.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/graphene/relay/connection.py b/graphene/relay/connection.py index 9a06e1eb5..4e52e3f5b 100644 --- a/graphene/relay/connection.py +++ b/graphene/relay/connection.py @@ -57,9 +57,6 @@ def __new__(cls, name, bases, attrs): options.local_fields = OrderedDict() assert options.node, 'You have to provide a node in {}.Meta'.format(cls.__name__) - assert issubclass(options.node, (Node, ObjectType)), ( - 'Received incompatible node "{}" for Connection {}.' - ).format(options.node, name) base_name = re.sub('Connection$', '', options.name) or options.node._meta.name if not options.name: From a77b27987e97504ff9c74ade696b36c174e4c612 Mon Sep 17 00:00:00 2001 From: Simon Hewitt Date: Mon, 19 Sep 2016 14:21:00 -0700 Subject: [PATCH 2/2] re-add node class check --- graphene/relay/connection.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/graphene/relay/connection.py b/graphene/relay/connection.py index 4e52e3f5b..a1039e439 100644 --- a/graphene/relay/connection.py +++ b/graphene/relay/connection.py @@ -6,13 +6,14 @@ from graphql_relay import connection_from_list -from ..types import AbstractType, Boolean, Int, List, String +from ..types import (AbstractType, Boolean, Enum, Int, Interface, List, NonNull, Scalar, String, + Union) from ..types.field import Field from ..types.objecttype import ObjectType, ObjectTypeMeta from ..types.options import Options from ..utils.is_base_type import is_base_type from ..utils.props import props -from .node import Node, is_node +from .node import is_node class PageInfo(ObjectType): @@ -57,6 +58,9 @@ def __new__(cls, name, bases, attrs): options.local_fields = OrderedDict() assert options.node, 'You have to provide a node in {}.Meta'.format(cls.__name__) + assert issubclass(options.node, (Scalar, Enum, ObjectType, Interface, Union, NonNull)), ( + 'Received incompatible node "{}" for Connection {}.' + ).format(options.node, name) base_name = re.sub('Connection$', '', options.name) or options.node._meta.name if not options.name: