Skip to content

Commit

Permalink
Update exchanges/graphcache/src/extras/simplePagination.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Jovi De Croock <[email protected]>
  • Loading branch information
hoangvvo and JoviDeCroock committed Nov 19, 2020
1 parent 9472c33 commit 7b9b54b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions exchanges/graphcache/src/extras/simplePagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ export const simplePagination = ({
visited.add(link);
}

const isAhead = !prevOffset || currentOffset > prevOffset;

if (isAhead === (mergeMode === 'inwards')) {
if (
(!prevOffset || currentOffset > prevOffset) ===
(mergeMode === 'inwards')
) {
result = [...result, ...tempResult];
} else {
result = [...tempResult, ...result];
Expand Down

0 comments on commit 7b9b54b

Please sign in to comment.