Files
Zafor Abdullah 93c59f02f8 fix: error handling and loading states in with-apollo-and-redux example (#91457)
## For Contributors

### Fixing a bug

- Fixes #(open or reference an issue if one exists, otherwise omit)
- No tests required — this is an `examples/` change only
- No custom error links needed — failures are surfaced via Apollo's
built-in error state

---

## Summary

- `PostList` destructured `data` before checking `loading`/`error`, so
the component threw when `data` was `undefined` (e.g., on the initial
fetch or after a query error) instead of showing the loading/error UI.
- Move the `error`/`loading`/`!data` guard clauses above the `data`
destructuring and `loadMorePosts` definition, and add a `!data` check so
the component never accesses properties on an undefined value.
- Bump `graphql` (`14.5.8` → `16.13.1`) and `lodash` (`4.17.20` →
`4.17.23`) in the example's `package.json` to pick up fixes in
dependencies the example relies on.

## Note: 
Initially this PR suppose to target upstream DB issue
2026-07-21 17:44:56 +02:00

22 lines
445 B
JSON

{
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@apollo/client": "^3.0.0",
"deepmerge": "^4.2.2",
"graphql": "16.13.1",
"lodash": "4.17.23",
"next": "latest",
"prop-types": "^15.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^7.1.1",
"redux": "^4.0.1",
"redux-devtools-extension": "2.13.8"
}
}