Skip to content

feat(query-core): improve useInfiniteQuery error handling - #7418

Merged
TkDodo merged 4 commits into
TanStack:mainfrom
jasongerbes:infinite-query-error-handling
May 12, 2024
Merged

feat(query-core): improve useInfiniteQuery error handling#7418
TkDodo merged 4 commits into
TanStack:mainfrom
jasongerbes:infinite-query-error-handling

Conversation

@jasongerbes

Copy link
Copy Markdown
Contributor

Fixes #7412

  • Add isFetchNextPageError and isFetchPreviousPageError.
  • Update isRefetchError to be consistent with isRefetching.
  • Update docs and type definitions for useInfiniteQuery.
  • Add unit tests.

Related #4465

@vercel

vercel Bot commented May 12, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview May 12, 2024 1:52pm

@codesandbox-ci

codesandbox-ci Bot commented May 12, 2024

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d9a2c6d:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

Comment thread docs/framework/react/reference/useInfiniteQuery.md
Comment thread packages/query-core/src/infiniteQueryObserver.ts
@nx-cloud

nx-cloud Bot commented May 12, 2024

Copy link
Copy Markdown

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d9a2c6d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@TkDodo TkDodo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a great contribution, thank you 🙏

@codecov-commenter

codecov-commenter commented May 12, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.22%. Comparing base (93674fe) to head (d9a2c6d).
⚠️ Report is 1660 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7418      +/-   ##
==========================================
- Coverage   41.42%   41.22%   -0.21%     
==========================================
  Files         184      182       -2     
  Lines        7331     7413      +82     
  Branches     1531     1558      +27     
==========================================
+ Hits         3037     3056      +19     
- Misses       3889     3945      +56     
- Partials      405      412       +7     
Components Coverage Δ
@tanstack/angular-query-devtools-experimental ∅ <ø> (∅)
@tanstack/angular-query-experimental 86.69% <87.50%> (+0.23%) ⬆️
@tanstack/eslint-plugin-query 85.46% <100.00%> (+0.17%) ⬆️
@tanstack/query-async-storage-persister 43.85% <100.00%> (-5.35%) ⬇️
@tanstack/query-broadcast-client-experimental ∅ <ø> (∅)
@tanstack/query-codemods 0.00% <0.00%> (ø)
@tanstack/query-core 92.96% <93.19%> (-0.30%) ⬇️
@tanstack/query-devtools 3.92% <0.00%> (-0.02%) ⬇️
@tanstack/query-persist-client-core 57.73% <ø> (ø)
@tanstack/query-sync-storage-persister 82.50% <ø> (ø)
@tanstack/react-query 92.77% <ø> (ø)
@tanstack/react-query-devtools 10.71% <ø> (ø)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client 100.00% <ø> (ø)
@tanstack/solid-query 77.74% <ø> (-4.53%) ⬇️
@tanstack/solid-query-devtools ∅ <ø> (∅)
@tanstack/solid-query-persist-client 100.00% <ø> (ø)
@tanstack/svelte-query 62.68% <ø> (ø)
@tanstack/svelte-query-devtools ∅ <ø> (∅)
@tanstack/svelte-query-persist-client 100.00% <ø> (ø)
@tanstack/vue-query 71.04% <ø> (+0.23%) ⬆️
@tanstack/vue-query-devtools ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TkDodo
TkDodo merged commit 8ce6642 into TanStack:main May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useInfiniteQuery: Explicit error handling for fetchNextPage/fetchPreviousPage

3 participants