Skip to content

docs(solid-query): correct 'initialData'/'select' JSDoc inaccuracy - #11576

Open
sukvvon wants to merge 1 commit into
mainfrom
docs/solid-query-jsdoc-inaccuracy-fixes
Open

sukvvon wants to merge 1 commit into
mainfrom
docs/solid-query-jsdoc-inaccuracy-fixes

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 22, 2026

Copy link
Copy Markdown
Member

🎯 Changes

DefinedInitialDataOptions, DefinedInitialDataInfiniteOptions, DefinedUseBaseQueryResult, DefinedUseQueryResult, DefinedUseInfiniteQueryResult, and the queryOptions/useQuery 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 (2 spots), infiniteQueryOptions.ts, useQuery.ts, and types.ts (3 spots).

Companion PRs for the same pattern: #11574 (@tanstack/react-query/@tanstack/preact-query), #11575 (@tanstack/vue-query). solid-query's useQueries (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.

✅ 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 that defined initial data guarantees non-undefined data unless a select function changes the result type to include undefined.
    • Updated API reference links to reflect current source locations.
    • Applied these clarifications consistently across query, infinite query, mutation, and result documentation.
  • No Functional Changes
    • Runtime behavior and public API signatures remain unchanged.

@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: 9517891f-fdc8-4eb5-8bac-83e535b1de27

📥 Commits

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

📒 Files selected for processing (21)
  • docs/framework/solid/reference/functions/queryOptions.md
  • docs/framework/solid/reference/functions/useQuery.md
  • docs/framework/solid/reference/interfaces/InfiniteQueryOptions.md
  • docs/framework/solid/reference/interfaces/MutationOptions.md
  • docs/framework/solid/reference/type-aliases/DefinedInitialDataInfiniteOptions.md
  • docs/framework/solid/reference/type-aliases/DefinedInitialDataOptions.md
  • docs/framework/solid/reference/type-aliases/DefinedUseBaseQueryResult.md
  • docs/framework/solid/reference/type-aliases/DefinedUseInfiniteQueryResult.md
  • docs/framework/solid/reference/type-aliases/DefinedUseQueryResult.md
  • docs/framework/solid/reference/type-aliases/UseBaseMutationResult.md
  • docs/framework/solid/reference/type-aliases/UseInfiniteQueryOptions.md
  • docs/framework/solid/reference/type-aliases/UseInfiniteQueryResult.md
  • docs/framework/solid/reference/type-aliases/UseMutateAsyncFunction.md
  • docs/framework/solid/reference/type-aliases/UseMutateFunction.md
  • docs/framework/solid/reference/type-aliases/UseMutationOptions.md
  • docs/framework/solid/reference/type-aliases/UseMutationResult.md
  • docs/framework/solid/reference/variables/createQuery.md
  • packages/solid-query/src/infiniteQueryOptions.ts
  • packages/solid-query/src/queryOptions.ts
  • packages/solid-query/src/types.ts
  • packages/solid-query/src/useQuery.ts

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


📝 Walkthrough

Walkthrough

The pull request updates Solid Query JSDoc and reference documentation. It clarifies that select can make defined query data include undefined and corrects source-definition line links.

Changes

Solid Query documentation alignment

Layer / File(s) Summary
Source JSDoc data guarantees
packages/solid-query/src/infiniteQueryOptions.ts, packages/solid-query/src/queryOptions.ts, packages/solid-query/src/types.ts, packages/solid-query/src/useQuery.ts
JSDoc now documents the select exception for defined query data.
Reference descriptions
docs/framework/solid/reference/functions/*, docs/framework/solid/reference/type-aliases/Defined*, docs/framework/solid/reference/variables/createQuery.md
Reference descriptions state that select can make TData include undefined.
Reference source links
docs/framework/solid/reference/interfaces/*, docs/framework/solid/reference/type-aliases/*, docs/framework/solid/reference/functions/queryOptions.md
Defined in links point to updated source line numbers.

Priority: ⬇️ Low

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

Change: Other

Possibly related PRs

Suggested reviewers: tkdodo

Merge Risk: ⚪ Minimal · up to d09e2

This update clarifies the documented select exception for undefined data and refreshes source links without changing library behavior. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation change and the corrected initialData/select JSDoc behavior.
Description check ✅ Passed The description explains the documentation correction, affected files, motivation, companion PRs, checklist completion, and docs-only release impact.
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 d09e283

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

☁️ Nx Cloud last updated this comment at 2026-09-22 06:42:04 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@11576

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: d09e283

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

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

This branch has not been deployed

No deployments
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