We’ve had a lot of customers ask how to return all the responses for a cursor-based paginated API, where:
- You make a request to an API
- API returns the first
nresults and a
cursoris used in a subsequent request to fetch the next
offset as our cursor.
offset is undefined-- that’s okay. We’ll be using the JS Query to inject the value through
additionalScope (more info here).
Now, we want to have a JS Query, like so: https://repl.it/@AntonyBello/Recursive-Fetch#index.js
This query recursively calls the API Query as many times as we have
offset returned to us (i.e., until we’ve returned all the data.)