Skip to content

Commit

Permalink
Update connections-pagination.md (#4423)
Browse files Browse the repository at this point in the history
Summary:
There are mistakes in Step 2 of the infinite scrolling tutorial.

- `newsfeedStories` is under `viewer`
- We are using `NewsfeedQuery` not `NewsfeedFragment`

In Step 5, the update is shown to a component `NewsfeedContents`, but that doesn't exist in the cloned repo. Is it something we are supposed to create when following along? I don't see this called out.

Step 6 then update the same `NewsfeedContents` to be different again, but in a way that seems as if the wrong component is being used in the example code? It's all a little confusing. This PR fixes a couple of mistakes, but I think the page needs a proper review by someone more familiar with the tutorial.

Pull Request resolved: #4423

Reviewed By: voideanvalue

Differential Revision: D48790897

Pulled By: alunyov

fbshipit-source-id: d94ab1706b34452548cc48e8097b272d9b755141
  • Loading branch information
michaelmcneilnet authored and facebook-github-bot committed Aug 30, 2023
1 parent 7a20c41 commit 563c570
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/docs/tutorial/connections-pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ We need to modify the Newsfeed component to map over the edges and render each n

```
function Newsfeed() {
const data = useLazyLoadQuery(NewsfeedFragment, {});
const data = useLazyLoadQuery(NewsfeedQuery, {});
// change-line
const storyEdges = data.newsfeedStories.edges;
const storyEdges = data.viewer.newsfeedStories.edges;
return (
<>
{storyEdges.map(storyEdge =>
Expand Down Expand Up @@ -376,7 +376,7 @@ Within `Newsfeed`, we can call both `useLazyLoadQuery` and `useFragment`, though
```
export default function Newsfeed() {
// change-line
const queryData = useLazyLoadQuery(NewsfeedFragment, {});
const queryData = useLazyLoadQuery(NewsfeedQuery, {});
// change-line
const data = useFragment(NewsfeedContentsFragment, queryData);
const storyEdges = data.newsfeedStories.edges;
Expand Down

0 comments on commit 563c570

Please sign in to comment.