Skip to content

feat(query-devtools) set data to undefined on Trigger Error in TanstackQueryDevtools - #10072

Merged
TkDodo merged 3 commits into
TanStack:mainfrom
ColemanDunn:feat(query-devtools)-set-data-to-undefined-on-Trigger-Error-in-TanstackQueryDevtools
Jan 30, 2026
Merged

feat(query-devtools) set data to undefined on Trigger Error in TanstackQueryDevtools#10072
TkDodo merged 3 commits into
TanStack:mainfrom
ColemanDunn:feat(query-devtools)-set-data-to-undefined-on-Trigger-Error-in-TanstackQueryDevtools

Conversation

@ColemanDunn

@ColemanDunnColemanDunn commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

🎯 Changes

Make Trigger Error set data to null so that error boundaries can be more easily tested using the devtools (no longer need to manually edit the data to trigger error boundary).

More info here: #10044

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error state handling in the DevTools query inspector. When triggering an error for an active query, the data state is now properly reset to undefined in addition to status and error properties, ensuring more accurate query state representation during error scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot

changeset-botBot commented Jan 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7528079

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
NameType
@tanstack/query-devtoolsMinor
@tanstack/angular-query-experimentalPatch
@tanstack/react-query-devtoolsPatch
@tanstack/solid-query-devtoolsPatch
@tanstack/svelte-query-devtoolsPatch
@tanstack/vue-query-devtoolsPatch
@tanstack/angular-query-persist-clientPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitaiBot commented Jan 26, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds a changeset file documenting a minor version bump for @tanstack/query-devtools. Modifies the QueryDetails component in Devtools.tsx to reset the data property to undefined when triggering an error for the active query.

Changes

Cohort / File(s)Summary
Changeset
.changeset/many-toes-speak.md
Documents minor version bump with description "Set data to undefined on Trigger Error"
Query Devtools
packages/query-devtools/src/Devtools.tsx
Adds data: undefined to state update in QueryDetails when triggering error, ensuring data property is cleared alongside error status

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • TkDodo
  • birkskyum

Poem

🐰 When errors hop into view,
Data vanishes, fresh and new,
Undefined paths clear the way,
Devtools recovers—hip hooray!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check nameStatusExplanation
Description check✅ PassedThe description follows the template with all required sections completed: Changes section explains the motivation, Checklist items are marked, and Release Impact indicates a changeset was generated.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check✅ PassedThe title accurately reflects the main change: setting data to undefined when triggering errors in the query devtools, which aligns with the PR objectives and file modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ColemanDunn

Copy link
Copy Markdown
ContributorAuthor

Do these changes count as dev-only (per This change is docs/CI/dev-only (no release))?

@ColemanDunnColemanDunn changed the title Set query data to undefined when an error is triggeredfeat(query-devtools)-set-data-to-undefined-on-Trigger-Error-in-TanstackQueryDevtoolsJan 26, 2026
@ColemanDunnColemanDunn changed the title feat(query-devtools)-set-data-to-undefined-on-Trigger-Error-in-TanstackQueryDevtoolsfeat(query-devtools) set data to undefined on Trigger Error in TanstackQueryDevtoolsJan 26, 2026
@nx-cloud

nx-cloudBot commented Jan 30, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 7528079

CommandStatusDurationResult
nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded4m 1sView ↗
nx run-many --target=build --exclude=examples/*...✅ Succeeded1sView ↗

☁️ Nx Cloud last updated this comment at 2026-01-30 09:25:40 UTC

@pkg-pr-new

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10072

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10072

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10072

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10072

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10072

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10072

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10072

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10072

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10072

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10072

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10072

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10072

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10072

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10072

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10072

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10072

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10072

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10072

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10072

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10072

commit: 7528079

@TkDodo
TkDodo merged commit 83366c4 into TanStack:mainJan 30, 2026
7 checks passed
@sentry

sentryBot commented Jan 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.35%. Comparing base (ed5e5fc) to head (7528079).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@ Coverage Diff @@## main #10072 +/- ##
===========================================
- Coverage 36.87% 18.35% -18.52% 
===========================================
Files 245 51 -194 Lines 11103 2936 -8167 Branches 2083 674 -1409 ===========================================
- Hits 4094 539 -3555 + Misses 6484 2134 -4350 + Partials 525 263 -262 
ComponentsCoverage Δ
@tanstack/angular-query-experimental46.35% <ø> (ø)
@tanstack/eslint-plugin-query∅ <ø> (∅)
@tanstack/query-async-storage-persister∅ <ø> (∅)
@tanstack/query-broadcast-client-experimental∅ <ø> (∅)
@tanstack/query-codemods∅ <ø> (∅)
@tanstack/query-core∅ <ø> (∅)
@tanstack/query-devtools3.38% <ø> (ø)
@tanstack/query-persist-client-core∅ <ø> (∅)
@tanstack/query-sync-storage-persister∅ <ø> (∅)
@tanstack/query-test-utils∅ <ø> (∅)
@tanstack/react-query∅ <ø> (∅)
@tanstack/react-query-devtools9.25% <ø> (ø)
@tanstack/react-query-next-experimental∅ <ø> (∅)
@tanstack/react-query-persist-client∅ <ø> (∅)
@tanstack/solid-query∅ <ø> (∅)
@tanstack/solid-query-devtools64.17% <ø> (ø)
@tanstack/solid-query-persist-client∅ <ø> (∅)
@tanstack/svelte-query∅ <ø> (∅)
@tanstack/svelte-query-devtools∅ <ø> (∅)
@tanstack/svelte-query-persist-client∅ <ø> (∅)
@tanstack/vue-query∅ <ø> (∅)
@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.

@github-actionsgithub-actionsBot mentioned this pull request Jan 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR has been released!

Thank you for your contribution!

Sign up for freeto 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.

2 participants

@ColemanDunn@TkDodo