Skip to content

docs(svelte-query): correct 'initialData'/'select' JSDoc inaccuracy - #11577

Merged
sukvvon merged 1 commit into
mainfrom
docs/svelte-query-jsdoc-inaccuracy-fixes
Sep 23, 2026
Merged

sukvvon merged 1 commit into
mainfrom
docs/svelte-query-jsdoc-inaccuracy-fixes

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 22, 2026

Copy link
Copy Markdown
Member

🎯 Changes

The queryOptions/createQuery overloads selected when initialData is set 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 and createQuery.ts.

Only these two spots make the unqualified claim in svelte-query: DefinedInitialDataOptions itself carries no JSDoc, and infiniteQueryOptions.ts/createInfiniteQuery.ts carry no initialData-related prose to correct.

Companion PRs for the same pattern: #11574 (@tanstack/react-query/@tanstack/preact-query), #11575 (@tanstack/vue-query), #11576 (@tanstack/solid-query). svelte-query's createQueries (the QueriesOptions array type) doesn't carry the equivalent user-facing JSDoc that react/preact had (it only has an internal implementation comment), so that half of the pattern doesn't apply here either, same as vue/solid.

✅ 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 query behavior when select transforms data to include undefined, even when initialData is provided.
    • Updated source references for documented overloads to point to the correct 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: 8e2d7af4-eaa6-41b6-8003-9b8d60728c31

📥 Commits

Reviewing files that changed from the base of the PR and between 129955c and 38691e9.

📒 Files selected for processing (4)
  • docs/framework/svelte/reference/functions/createQuery.md
  • docs/framework/svelte/reference/functions/queryOptions.md
  • packages/svelte-query/src/createQuery.ts
  • packages/svelte-query/src/queryOptions.ts

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


📝 Walkthrough

Walkthrough

The change updates Svelte Query overload documentation. It clarifies that select can make data undefined when it changes TData, and corrects source links in the Svelte reference pages.

Changes

Svelte Query documentation

Layer / File(s) Summary
Clarify overload data behavior
packages/svelte-query/src/createQuery.ts, packages/svelte-query/src/queryOptions.ts
The overload comments now document that select can transform TData to include undefined, even when initialData is set.
Synchronize reference documentation
docs/framework/svelte/reference/functions/createQuery.md, docs/framework/svelte/reference/functions/queryOptions.md
The reference pages include the same select exception and point their “Defined in” links to the updated source lines.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to 38691

This documentation update clarifies the existing select behavior without changing runtime code or published APIs, 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 main change: correcting the initialData and select JSDoc for Svelte Query.
Description check ✅ Passed The description explains the correction, its scope, related files, testing status, checklist completion, and release impact. It matches the required template and states that no changeset is needed bec…
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 2…
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 38691e9

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

☁️ Nx Cloud last updated this comment at 2026-09-22 06:41:37 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.

@sukvvon sukvvon self-assigned this Sep 22, 2026
@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@11577

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 38691e9

@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 merged commit 04c0fa1 into main Sep 23, 2026
9 checks passed
@sukvvon
sukvvon deleted the docs/svelte-query-jsdoc-inaccuracy-fixes branch September 23, 2026 03:21
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