facebook / facebook/relay

Bug: loadNext doesn't work when usePaginationFragment is combined with the root Query type

Open
#4,015 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

## Reporting issues with Relay
Data is fetched but the state is not updated.
This happens when I name the fragment using the root Query type:
https://github.com/kgtkr/relay-examples/blob/5a4f2872b1ee7be75ea8366df39b91763d56e8f4/issue-tracker/src/IssueDetailRoot.js#L35

bug sample code:
https://github.com/kgtkr/relay-examples/commit/5a4f2872b1ee7be75ea8366df39b91763d56e8f4

bug fixed sample code:
https://github.com/kgtkr/relay-examples/commit/98f66346649ef274a18347117ed8f1afcfb4e39c

screen capture:
https://gyazo.com/929455c87d8ff94ae63a01d32a1470ba

Also, if I click load more multiple times, the following message will be output to the console.
```
Warning: Relay: Unexpected after cursor `XXXX`, edges must be fetched from the end of the list (`YYYY`).
```

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.