mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-13 13:16:49 +03:00
Added relay PageInfo, Connection super constructors. Fixed #131
This commit is contained in:
parent
bf60aca951
commit
21ec1163b9
|
@ -20,7 +20,8 @@ from .fields import GlobalIDField
|
||||||
class PageInfo(ObjectType):
|
class PageInfo(ObjectType):
|
||||||
|
|
||||||
def __init__(self, start_cursor="", end_cursor="",
|
def __init__(self, start_cursor="", end_cursor="",
|
||||||
has_previous_page=False, has_next_page=False):
|
has_previous_page=False, has_next_page=False, **kwargs):
|
||||||
|
super(PageInfo, self).__init__(**kwargs)
|
||||||
self.startCursor = start_cursor
|
self.startCursor = start_cursor
|
||||||
self.endCursor = end_cursor
|
self.endCursor = end_cursor
|
||||||
self.hasPreviousPage = has_previous_page
|
self.hasPreviousPage = has_previous_page
|
||||||
|
@ -58,7 +59,8 @@ class Edge(ObjectType):
|
||||||
class Connection(ObjectType):
|
class Connection(ObjectType):
|
||||||
'''A connection to a list of items.'''
|
'''A connection to a list of items.'''
|
||||||
|
|
||||||
def __init__(self, edges, page_info):
|
def __init__(self, edges, page_info, **kwargs):
|
||||||
|
super(Connection, self).__init__(**kwargs)
|
||||||
self.edges = edges
|
self.edges = edges
|
||||||
self.pageInfo = page_info
|
self.pageInfo = page_info
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user