facebook / facebook/relay

In usePaginationFragment onComplete callback for loadNext missing incremental data payloads

Open
#4,855 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Per the documentation https://relay.dev/docs/api-reference/use-pagination-fragment/#behavior

> loadNext: Function used to fetch more items in the connection in the "forward" direction.
Arguments:
count: Number that indicates how many items to query for in the pagination request.
options: [Optional] options object
onComplete: Function that will be called whenever the refetch request has completed, **including any incremental data payloads**. If an error occurs during the request, onComplete will be called with an Error object as the first parameter.

When the callback onComplete is called there is no incremental data supplied? How can I get the increment page that was fetched from the server?

` const handlePageLoad = (page) => {
console.log(page)
}`

`const handlePaginationModelChange = (newPaginationModel: GridPaginationModel) => {
loadNext(newPaginationModel.pageSize, {onComplete: handlePageLoad})
};`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.