Skip to content

docs(vue-query): correct 'initialData'/'select' JSDoc inaccuracy - #11575

Merged
sukvvon merged 2 commits into
mainfrom
docs/vue-query-jsdoc-inaccuracy-fixes
Sep 23, 2026
Merged

sukvvon merged 2 commits into
mainfrom
docs/vue-query-jsdoc-inaccuracy-fixes

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 22, 2026

Copy link
Copy Markdown
Member

🎯 Changes

DefinedInitialQueryOptions, DefinedInitialDataInfiniteOptions, and the queryOptions/useQuery/infiniteQueryOptions/useInfiniteQuery overloads selected when initialData is set all stated that data is "never undefined" without qualification. This is only true when no select is used — a select can change TData to a type that includes undefined. Added the (unless a select changes TData to include undefined) qualifier in queryOptions.ts, infiniteQueryOptions.ts (2 spots), useInfiniteQuery.ts, and useQuery.ts.

In useQuery.ts, the @returns doc for this overload previously packed the status caveat inside the same parenthetical as the undefined claim; it's now split into its own sentence so the new select caveat doesn't get buried alongside it.

Companion PR for @tanstack/react-query/@tanstack/preact-query: #11574. vue-query's UseQueriesOptions (the queries array type for useQueries) doesn't carry the equivalent user-facing JSDoc that react/preact had (it only has an internal implementation comment), so that part of the pattern doesn't apply here and isn't touched in this PR.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 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
    • Clarified Vue Query API documentation for queries and infinite queries with initial data.
    • Documented that data is defined by default, but may become undefined when a select transformation allows it.
    • Updated source references to point to the correct declaration locations.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: TanStack/query/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c4465106-0677-4043-bd61-8eca84abc006

📥 Commits

Reviewing files that changed from the base of the PR and between 54f67f1 and e2ba4c9.

📒 Files selected for processing (2)
  • docs/framework/vue/reference/type-aliases/DefinedInitialQueryOptions.md
  • packages/vue-query/src/queryOptions.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vue-query/src/queryOptions.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The pull request updates Vue Query JSDoc and reference documentation. Defined-data overloads now document the select caveat, and source links use updated line numbers. No runtime behavior changes.

Changes

Vue Query documentation

Layer / File(s) Summary
Source API documentation
packages/vue-query/src/infiniteQueryOptions.ts, packages/vue-query/src/queryOptions.ts, packages/vue-query/src/useInfiniteQuery.ts, packages/vue-query/src/useQuery.ts
JSDoc for defined-data overloads states that select can change TData to include undefined. The useQuery return documentation also separates this caveat from the non-pending status guarantee.
Reference documentation
docs/framework/vue/reference/functions/*.md, docs/framework/vue/reference/type-aliases/*.md
Reference descriptions include the same select caveat. Updated Defined in links point to the new source line numbers.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: tinas

Merge Risk: ⚪ Minimal · up to e2ba4

This change clarifies when selected query data may be undefined without changing library behavior, so it is ready to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Vue Query documentation change and the corrected initialData/select JSDoc behavior.
Description check ✅ Passed The description follows the required template, explains the documentation changes and motivation, completes the checklist, and identifies the release impact as docs-only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@nx-cloud

nx-cloud Bot commented Sep 22, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 54f67f1

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

☁️ Nx Cloud last updated this comment at 2026-09-22 06:36:43 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Sep 22, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11575

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@11575

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@11575

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: e2ba4c9

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.87 KB (0%)
react minimal 8.85 KB (0%)

@sukvvon sukvvon self-assigned this Sep 22, 2026
@sukvvon
sukvvon merged commit 96919ca into main Sep 23, 2026
9 checks passed
@sukvvon
sukvvon deleted the docs/vue-query-jsdoc-inaccuracy-fixes branch September 23, 2026 03:20
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