Skip to content

test(svelte-query/createInfiniteQuery): add type tests for page params, 'initialData', 'select', and 'Accessor<QueryClient>'#10503

Merged
sukvvon merged 1 commit intomainfrom
test/svelte-query-createInfiniteQuery-type-tests
Apr 15, 2026
Merged

test(svelte-query/createInfiniteQuery): add type tests for page params, 'initialData', 'select', and 'Accessor<QueryClient>'#10503
sukvvon merged 1 commit intomainfrom
test/svelte-query-createInfiniteQuery-type-tests

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 15, 2026

🎯 Changes

Add type tests for createInfiniteQuery in svelte-query, covering:

  • pageParam and direction type inference in queryFn
  • fetchInfiniteQuery / prefetchInfiniteQuery page param types
  • initialData type inference (always includes undefined — no DefinedInitialDataInfiniteOptions overload)
  • select data transformation
  • getNextPageParam / getPreviousPageParam typed params
  • Error booleans (isFetchNextPageError, isFetchPreviousPageError, isLoadingError, isRefetchError)
  • Accessor<QueryClient> second argument

✅ 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

  • Tests
    • Added type declaration tests for infinite query functionality to ensure correct type inference across pagination and error scenarios.

…s, 'initialData', 'select', and 'Accessor<QueryClient>'
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 589db938-f3ed-43cc-b6a1-c0e945aa53d9

📥 Commits

Reviewing files that changed from the base of the PR and between df77d8c and c707e4b.

📒 Files selected for processing (1)
  • packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts

📝 Walkthrough

Walkthrough

This pull request adds a new TypeScript declaration test file for createInfiniteQuery that validates type inference for page parameters, direction field, data return types, callback parameters, and error states across multiple query operations.

Changes

Cohort / File(s) Summary
Infinite Query Type Tests
packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test-d.ts
New TypeScript declaration test file validating type inference for pageParam, direction, data return types, callback parameters, and error states in createInfiniteQuery, fetchInfiniteQuery, and prefetchInfiniteQuery.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 hops through infinite queries with glee
Each pageParam typed perfectly,
Forward, backward, directions so clear,
Testing keeps the types sincere,
No type errors lurking here! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding type tests for createInfiniteQuery with focus on page params, initialData, select, and Accessor.
Description check ✅ Passed The description follows the template structure with all required sections completed: 🎯 Changes section details the type tests added, ✅ Checklist items are marked, and 🚀 Release Impact correctly indicates this is dev-only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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 test/svelte-query-createInfiniteQuery-type-tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 15, 2026

View your CI Pipeline Execution ↗ for commit c707e4b

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

☁️ Nx Cloud last updated this comment at 2026-04-15 08:00:29 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
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 15, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: c707e4b

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.99 KB (0%)
react minimal 9.02 KB (0%)

@sukvvon sukvvon self-assigned this Apr 15, 2026
@sukvvon sukvvon merged commit da62c8a into main Apr 15, 2026
10 checks passed
@sukvvon sukvvon deleted the test/svelte-query-createInfiniteQuery-type-tests branch April 15, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant