From 631fa23249e4244b885b303c225c8cfcf509a1f8 Mon Sep 17 00:00:00 2001 From: Markus Padourek Date: Tue, 7 Jun 2016 10:04:42 +0100 Subject: [PATCH] Get proper connection type for SimpleConnection --- graphene/relay/fields.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graphene/relay/fields.py b/graphene/relay/fields.py index e79b9592..9bd097ec 100644 --- a/graphene/relay/fields.py +++ b/graphene/relay/fields.py @@ -46,6 +46,10 @@ class ConnectionField(Field): def get_connection_type(self, node): connection_type = self.connection_type or node.get_connection_type() + + if issubclass(connection_type, SimpleConnection): + return connection_type.for_node(node) + edge_type = self.get_edge_type(node) return connection_type.for_node(node, edge_type=edge_type) @@ -105,3 +109,5 @@ class GlobalIDField(Field): def resolver(self, instance, args, info): return instance.to_global_id() + +from .types import SimpleConnection