File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ export function prepareConnectionResolver(
8989 ) ;
9090 const sortOptions : connectionSortOpts = args . sort ;
9191
92+
9293 let filter = resolveParams . args . filter || { } ;
9394 const beginCursorData = cursorToData ( args . after ) ;
9495 if ( beginCursorData ) {
@@ -134,7 +135,7 @@ findManyParams.projection['count'] = true;
134135findManyParams . projection [ 'age' ] = true ;
135136findManyParams . projection [ 'name' ] = true ;
136137
137- const hasPreviousPage = skip > 0 ;
138+ const hasPreviousPage = ! ! args . last && skip > 0 ;
138139 let hasNextPage = false ; // will be requested +1 document, to check next page presence
139140
140141 const filterDataForCursor = ( record ) => {
@@ -152,7 +153,7 @@ console.log(findManyParams.args);
152153 const edges = [ ] ;
153154 // if returned more than `limit` records, strip array and mark that exists next page
154155 if ( recordList . length > limit ) {
155- hasNextPage = true ;
156+ hasNextPage = ! ! args . first ;
156157 recordList = recordList . slice ( 0 , limit ) ;
157158 }
158159 // transform record to object { cursor, node }
You can’t perform that action at this time.
0 commit comments