facebook / facebook/relay

[Modern] ReactRelayPaginationContainer pageInfo warning

Open
#1,852 10 comments 19 reactions 0 assignees View on GitHub
bug wontfix
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

The ReactRelayPaginationContainer complains about missing pageInfo fields whenever no edges are returned from a connection. Specifically, I am seeing this warning whenever pageInfo.endCursor === null. I am able to silence the warning by returning an empty string for pageInfo.endCursor. Is an empty string the expected value in this situation or am I missing something else?

Example response:
```
{
"data": {
"user": {
"postsConnection": {
"edges": [],
"pageInfo": {
"hasNextPage": false,
"endCursor": null,
"hasPreviousPage": false,
"startCursor": null
}
}
}
}
}
```

Warning:
```
Warning: ReactRelayPaginationContainer: Cannot paginate without pageInfo fields in `MyView`. Be sure to fetch hasNextPage (got `false`) and endCursor (got `null`).
```

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.