Skip to content

docs(preact-query): add 'select' example to 'useQuery' - #11343

Merged
sukvvon merged 3 commits into
mainfrom
docs/preact-query-usequery-select-example
Aug 31, 2026
Merged

docs(preact-query): add 'select' example to 'useQuery'#11343
sukvvon merged 3 commits into
mainfrom
docs/preact-query-usequery-select-example

Conversation

@sukvvon

@sukvvon sukvvon commented Aug 31, 2026

Copy link
Copy Markdown
Member

🎯 Changes

useQuery's select option had no @example showing its usage, despite the other 8 examples on this overload covering initialData, isPending/isError, enabled, skipToken, seeding, and pagination.

  • useQuery.ts: added an example showing select deriving a number (post count) from the cached Post[] — a type-changing transform, so the example demonstrates the reason select exists (TData can differ from what's cached) rather than a subset that would render the same as the basic example above it. Placed right after the basic example, since select is a more commonly used option than the dependent-query/pagination examples that follow.
  • Regenerated docs/framework/preact/reference/functions/useQuery.md with pnpm run generate-docs

✅ 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
    • Corrected the referenced source-code line for the third useQuery overload.
    • Moved the select option example before the dependent-query examples.
    • Updated the example to show deriving a post count while retaining the complete results in the cache.
    • Clarified how transformed data is displayed separately from the cached result.

@nx-cloud

nx-cloud Bot commented Aug 31, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit fb0e81e

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

☁️ Nx Cloud last updated this comment at 2026-08-31 03:02:04 UTC

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dd1324c3-4aa2-4cac-a83d-a895254d76b7

📥 Commits

Reviewing files that changed from the base of the PR and between fb5512a and 362adb0.

📒 Files selected for processing (2)
  • docs/framework/preact/reference/functions/useQuery.md
  • packages/preact-query/src/useQuery.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/preact-query/src/useQuery.ts
  • docs/framework/preact/reference/functions/useQuery.md

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


📝 Walkthrough

Walkthrough

The Preact useQuery documentation now demonstrates select projection to a post count and corrects the source link for the third overload. Runtime code does not change.

Changes

useQuery select documentation

Layer / File(s) Summary
Add select example and update reference
docs/framework/preact/reference/functions/useQuery.md, packages/preact-query/src/useQuery.ts
The examples project Post[] data into a post count while the cache retains the full posts. The source link now points to line 281.

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

Merge Risk: ⚪ Minimal · up to 362ad

This documentation-only change adds a localized select example and regenerates the corresponding reference page; no actionable merge-blocking risk remains after normal checks and review.

🚥 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. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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 concisely describes the main change: adding a select example to the Preact Query useQuery documentation.
Description check ✅ Passed The description follows the required template, explains the documentation change and motivation, records documentation generation, completes the checklist, and identifies the change as having no relea…
Full details: Docstring Coverage

Explanation

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 1 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description follows the required template, explains the documentation change and motivation, records documentation generation, completes the checklist, and identifies the change as having no release impact.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/preact-query-usequery-select-example

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.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 24 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/query-core 5.102.8 → 5.102.9 Changeset
@tanstack/angular-query-experimental 5.102.8 → 5.102.9 Dependent
@tanstack/angular-query-persist-client 5.102.8 → 5.102.9 Dependent
@tanstack/eslint-plugin-query 5.102.8 → 5.102.9 Dependent
@tanstack/lit-query 0.2.20 → 0.2.21 Dependent
@tanstack/preact-query 5.102.8 → 5.102.9 Dependent
@tanstack/preact-query-devtools 5.102.8 → 5.102.9 Dependent
@tanstack/preact-query-persist-client 5.102.8 → 5.102.9 Dependent
@tanstack/query-async-storage-persister 5.102.8 → 5.102.9 Dependent
@tanstack/query-broadcast-client-experimental 5.102.8 → 5.102.9 Dependent
@tanstack/query-devtools 5.102.8 → 5.102.9 Dependent
@tanstack/query-persist-client-core 5.102.8 → 5.102.9 Dependent
@tanstack/query-sync-storage-persister 5.102.8 → 5.102.9 Dependent
@tanstack/react-query 5.102.8 → 5.102.9 Dependent
@tanstack/react-query-devtools 5.102.8 → 5.102.9 Dependent
@tanstack/react-query-next-experimental 5.102.8 → 5.102.9 Dependent
@tanstack/react-query-persist-client 5.102.8 → 5.102.9 Dependent
@tanstack/solid-query 5.102.8 → 5.102.9 Dependent
@tanstack/solid-query-devtools 5.102.8 → 5.102.9 Dependent
@tanstack/solid-query-persist-client 5.102.8 → 5.102.9 Dependent
@tanstack/svelte-query 6.1.48 → 6.1.49 Dependent
@tanstack/svelte-query-devtools 6.1.48 → 6.1.49 Dependent
@tanstack/svelte-query-persist-client 6.1.48 → 6.1.49 Dependent
@tanstack/vue-query 5.102.8 → 5.102.9 Dependent
@tanstack/vue-query-devtools 6.1.48 → 6.1.49 Dependent

@pkg-pr-new

pkg-pr-new Bot commented Aug 31, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 362adb0

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

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

@sukvvon sukvvon self-assigned this Aug 31, 2026
@sukvvon
sukvvon merged commit 2b44804 into main Aug 31, 2026
9 checks passed
@sukvvon
sukvvon deleted the docs/preact-query-usequery-select-example branch August 31, 2026 03:29
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