We can limit the number of responses that we receive from a Graph object connection by simply using the limit option in our requests. By taking advantage of the limit and offset capabilities of the Graph API we can add paging to our data—requesting a large set of data in several smaller chunks.
In this recipe, we're going to implement paging for a connection request—reducing what would otherwise be a list of hundreds of images down to only ten at a time, with components onscreen that allow us to customize the number of results for each 'page' and navigate forward and backward through those pages.
The initial starting point for this recipe should be that of our earlier recipe, Building a Test Console for the Graph API. To this basic interface, we should add several components to test the pagination capabilities of our requests. These should be a NumericStepper component, increments_stp
; two Button components, prev_btn
and next_btn
; and...