Skip to content

Commit

Permalink
Update App.js
Browse files Browse the repository at this point in the history
Without this change you get: `TypeError: Cannot read property 'people' of undefined`
  • Loading branch information
Zache authored Sep 18, 2019
1 parent dcdfe5f commit 3fe5096
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ALL_PEOPLE = gql`
export default function App() {
const {
loading,
data: { people }
data
} = useQuery(ALL_PEOPLE);

return (
Expand All @@ -28,7 +28,7 @@ export default function App() {
<p>Loading…</p>
) : (
<ul>
{people.map(person => (
{data.people.map(person => (
<li key={person.id}>{person.name}</li>
))}
</ul>
Expand Down

0 comments on commit 3fe5096

Please sign in to comment.