Skip to content

docs(reference/QueryClient): clarify query client query methods#10725

Open
0Jaemin0 wants to merge 1 commit into
TanStack:mainfrom
0Jaemin0:docs/query-client-method-notes
Open

docs(reference/QueryClient): clarify query client query methods#10725
0Jaemin0 wants to merge 1 commit into
TanStack:mainfrom
0Jaemin0:docs/query-client-method-notes

Conversation

@0Jaemin0
Copy link
Copy Markdown

@0Jaemin0 0Jaemin0 commented May 18, 2026

🎯 Changes

Clarifies the differences between queryClient.invalidateQueries, queryClient.refetchQueries, and queryClient.removeQueries in the QueryClient reference docs.

These methods can look similar because they all match queries by filters, so this adds short Notes explaining whether each method invalidates, refetches, keeps, or removes matching queries.

✅ 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

  • Documentation
    • Improved QueryClient reference documentation with clarification notes for three key query management methods. Now clearly explains how invalidateQueries marks queries as invalid before refetching, how refetchQueries refetches without invalidation, and how removeQueries removes queries from cache rather than refetching them.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

Documentation for three QueryClient methods was updated with clarifying "Notes" sections. invalidateQueries notes explain it invalidates and refetches per refetchType while keeping queries in cache. refetchQueries notes clarify it refetches without prior invalidation. removeQueries notes specify it removes queries from cache instead of refetching.

Changes

QueryClient method documentation clarifications

Layer / File(s) Summary
QueryClient method behavior notes
docs/reference/QueryClient.md
Added "Notes" sections to invalidateQueries, refetchQueries, and removeQueries distinguishing their behavior: invalidation + refetch with cache retention, refetch-only, and cache removal respectively.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A rabbit hops through docs so bright,
Adding notes to set things right—
invalidateQueries keeps cache around,
While removeQueries clears the ground! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding clarification notes to the QueryClient reference documentation for three query methods.
Description check ✅ Passed The PR description follows the required template with all major sections completed, including Changes, Checklist, and Release Impact, with appropriate details about documentation updates.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@0Jaemin0 0Jaemin0 changed the title docs(reference): clarify query client query methods docs(reference/QueryClient): clarify query client query methods May 18, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 18, 2026

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 4f203aa

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ❌ Failed 1m 53s View ↗
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 18s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-18 17:59:57 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant