18
18
19
19
20
20
class PageInfo (ObjectType ):
21
- has_next_page = Boolean (
21
+
22
+ def __init__ (self , start_cursor = "" , end_cursor = "" ,
23
+ has_previous_page = False , has_next_page = False ):
24
+ self .startCursor = start_cursor
25
+ self .endCursor = end_cursor
26
+ self .hasPreviousPage = has_previous_page
27
+ self .hasNextPage = has_next_page
28
+
29
+ hasNextPage = Boolean (
22
30
required = True ,
23
31
description = 'When paginating forwards, are there more items?' )
24
- has_previous_page = Boolean (
32
+ hasPreviousPage = Boolean (
25
33
required = True ,
26
34
description = 'When paginating backwards, are there more items?' )
27
- start_cursor = String (
35
+ startCursor = String (
28
36
description = 'When paginating backwards, the cursor to continue.' )
29
- end_cursor = String (
37
+ endCursor = String (
30
38
description = 'When paginating forwards, the cursor to continue.' )
31
39
32
40
@@ -49,11 +57,16 @@ def for_node(cls, node):
49
57
50
58
class Connection (ObjectType ):
51
59
'''A connection to a list of items.'''
60
+
61
+ def __init__ (self , edges , page_info ):
62
+ self .edges = edges
63
+ self .pageInfo = page_info
64
+
52
65
class Meta :
53
66
type_name = 'DefaultConnection'
54
67
55
- page_info = Field (PageInfo , required = True ,
56
- description = 'The Information to aid in pagination' )
68
+ pageInfo = Field (PageInfo , required = True ,
69
+ description = 'The Information to aid in pagination' )
57
70
58
71
_connection_data = None
59
72
0 commit comments