Skip to content

[pull] main from TanStack:main#451

Merged
pull[bot] merged 6 commits intomanudeli:mainfrom
TanStack:main
Apr 25, 2026
Merged

[pull] main from TanStack:main#451
pull[bot] merged 6 commits intomanudeli:mainfrom
TanStack:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 25, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

chosule and others added 6 commits April 25, 2026 11:09
* fix: preserve infinite query behavior during SSR hydration (#8825)

* chore: add changeset for #8825

* refactor: apply review feedback
- Remove isRejectedThenable check
- Inline behavior assignment

* refactor: remove unnecessary `any` type assertions

* refactor: store query type in Query instead of injecting behavior
- Add a type field to Query, set from the _type marker
- In Query.fetch(), apply infiniteQueryBehavior automatically when type === 'infiniteQuery'
- Remove direct behavior injection from infiniteQueryObserver, fetchInfiniteQuery, ensureInfiniteQueryData, and hydrate()
- In hydrate(), pass the _type marker instead of behavior to fix a regression where user-provided hydrate defaultOptions.queries.behavior could be overwritten
- Add regression tests for the SSR -> dehydrate -> hydrate -> refetch flow

* ci: apply automated fixes

* ref: use optional type: 'infinite' everywhere

* fix: don't send full queries into queryClient methods

* fix: let's stick with queryType as the public name

* fix: test -> it

---------

Co-authored-by: kimchosule <kimchosule1@bizbee.co.kr>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix(query-core): stop wrapping persister generics in NoInfer

The `persister` field on QueryOptions was typed as
`QueryPersister<NoInfer<TQueryFnData>, NoInfer<TQueryKey>, NoInfer<TPageParam>>`
so persister could not contribute to TQueryFnData inference. When the
companion queryFn declared a parameter (e.g. `(_context) => 'test'`),
TypeScript failed to infer TQueryFnData from its return and defaulted
to `unknown`, causing a spurious overload mismatch against a
concretely-typed persister (fixes #7842).

Removing the NoInfer wrappers lets persister participate in inference.
Genuine type conflicts between persister and queryFn still surface as
errors (covered by a new negative type test in queryOptions.test-d.tsx).

Co-Authored-By: Claude <noreply@anthropic.com>

* test(react-query): wrap negative type tests in assertType

Addresses CodeRabbit nitpick: vitest/expect-expect flagged the
genuine-conflict test as having no assertions. Wrap both calls in
assertType() so the linter sees an explicit assertion while the
`@ts-expect-error` directives continue to enforce the type mismatch.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* useSuspenseQueries combine

* useSuspenseQueries combine

* ci: apply automated fixes

* fix: stale data

* ci: apply automated fixes (attempt 3/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.