mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 23:20:47 +03:00
fix linting issues in connection py
This commit is contained in:
parent
2a288eab9d
commit
18bb5030af
|
@ -28,6 +28,7 @@ class PageInfo(ObjectType):
|
||||||
endCursor = String(
|
endCursor = String(
|
||||||
description='When paginating forwards, the cursor to continue.')
|
description='When paginating forwards, the cursor to continue.')
|
||||||
|
|
||||||
|
|
||||||
class Edge(ObjectType):
|
class Edge(ObjectType):
|
||||||
'''An edge in a connection.'''
|
'''An edge in a connection.'''
|
||||||
cursor = String(
|
cursor = String(
|
||||||
|
@ -36,8 +37,6 @@ class Edge(ObjectType):
|
||||||
@classmethod
|
@classmethod
|
||||||
@memoize
|
@memoize
|
||||||
def for_node(cls, node):
|
def for_node(cls, node):
|
||||||
from graphene.relay.utils import is_node
|
|
||||||
# assert is_node(node), 'ObjectTypes in a edge have to be Nodes'
|
|
||||||
node_field = Field(node, description='The item at the end of the edge')
|
node_field = Field(node, description='The item at the end of the edge')
|
||||||
return type(
|
return type(
|
||||||
'%s%s' % (node._meta.type_name, cls._meta.type_name),
|
'%s%s' % (node._meta.type_name, cls._meta.type_name),
|
||||||
|
@ -64,7 +63,6 @@ class Connection(ObjectType):
|
||||||
@classmethod
|
@classmethod
|
||||||
@memoize
|
@memoize
|
||||||
def for_node(cls, node, edge_type=None):
|
def for_node(cls, node, edge_type=None):
|
||||||
from graphene.relay.utils import is_node
|
|
||||||
edge_type = edge_type or Edge.for_node(node)
|
edge_type = edge_type or Edge.for_node(node)
|
||||||
edges = List(edge_type, description='Information to aid in pagination.')
|
edges = List(edge_type, description='Information to aid in pagination.')
|
||||||
return type(
|
return type(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user