-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or requesthacktoberfesthelp wantedExtra attention is neededExtra attention is needed
Description
Support pulling next URL from response body, such as for HATEOAS APIs.
HATEOAS response might look like:
{
"_links": {
"self": { "href": "/orders" },
"next": { "href": "/orders?page=2" },
"find": { "href": "/orders{?id}", "templated": true }
},
"currentlyProcessing": 14,
"shippedToday": 20
}fetchPaginate('https://api.example.com', {
getNextUrl: ({ body }) => body?._links?.next?.href
})or possibly support a string path (nicer for CLI):
fetchPaginate('https://api.example.com', {
getNextUrl: '_links.next.href'
})Not sure how (or whether) to handle templated links.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthacktoberfesthelp wantedExtra attention is neededExtra attention is needed