mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-25 23:39:49 +03:00
Allow node interface to be used in ConnectionField
This commit is contained in:
parent
631fa23249
commit
226b27fc4e
|
@ -58,10 +58,10 @@ class ConnectionField(Field):
|
||||||
return edge_type.for_node(node)
|
return edge_type.for_node(node)
|
||||||
|
|
||||||
def get_type(self, schema):
|
def get_type(self, schema):
|
||||||
from graphene.relay.utils import is_node
|
from graphene.relay.utils import is_node, is_node_type
|
||||||
type = schema.T(self.type)
|
type = schema.T(self.type)
|
||||||
node = schema.objecttype(type)
|
node = schema.objecttype(type)
|
||||||
assert is_node(node), 'Only nodes have connections.'
|
assert is_node(node) or is_node_type(node), 'Only nodes have connections.'
|
||||||
schema.register(node)
|
schema.register(node)
|
||||||
connection_type = self.get_connection_type(node)
|
connection_type = self.get_connection_type(node)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user