Skip to content

Commit

Permalink
Fix pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
TimonVS committed Apr 3, 2019
1 parent 97f1f3c commit 8a0e70f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function paginate(queryFn, query, variables, dataPath) {
while (hasNextPage) {
const newData = await queryFn(query, {
...variables,
after: [...dataPath, 'endCursor']
after: _.get(data, [...dataPath, 'pageInfo', 'endCursor'])
})
const newNodes = _.get(newData, nodesPath)
hasNextPage = getHasNextPage(newData, dataPath)
Expand Down

0 comments on commit 8a0e70f

Please sign in to comment.