File tree 1 file changed +3
-2
lines changed 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ export function prepareConnectionResolver(
89
89
) ;
90
90
const sortOptions : connectionSortOpts = args . sort ;
91
91
92
+
92
93
let filter = resolveParams . args . filter || { } ;
93
94
const beginCursorData = cursorToData ( args . after ) ;
94
95
if ( beginCursorData ) {
@@ -134,7 +135,7 @@ findManyParams.projection['count'] = true;
134
135
findManyParams . projection [ 'age' ] = true ;
135
136
findManyParams . projection [ 'name' ] = true ;
136
137
137
- const hasPreviousPage = skip > 0 ;
138
+ const hasPreviousPage = ! ! args . last && skip > 0 ;
138
139
let hasNextPage = false ; // will be requested +1 document, to check next page presence
139
140
140
141
const filterDataForCursor = ( record ) => {
@@ -152,7 +153,7 @@ console.log(findManyParams.args);
152
153
const edges = [ ] ;
153
154
// if returned more than `limit` records, strip array and mark that exists next page
154
155
if ( recordList . length > limit ) {
155
- hasNextPage = true ;
156
+ hasNextPage = ! ! args . first ;
156
157
recordList = recordList . slice ( 0 , limit ) ;
157
158
}
158
159
// transform record to object { cursor, node }
You can’t perform that action at this time.
0 commit comments