* test(vue-query): add test for clone getters returning values in queryKey
* fix(vue-query): improve typing in vueQueryPlugin.test.ts to resolve errors on tsc
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* let’s do it again
* fix test group
* maybe
* mkay
* cool
* rm console.logs
* mkay
* mkay
* fix(vue-query): invalidate queries immediately after calling `invalidateQueries` (#7930)
* fix(vue-query): invalidate queries immediately after call `invalidateQueries`
* chore: recovery code comments
* release: v5.53.2
* docs(vue-query): update SSR guide for nuxt2 (#8001)
* docs: update SSR guide for nuxt2
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* thenable
* mkay
* Update packages/react-query/src/__tests__/useQuery.test.tsx
* mkay
* mkay
* faster and more consistent
* mkay
* mkay
* mkay
* mkay
* mkay
* fix unhandled rejections
* more
* more
* mkay
* fix more
* fixy
* cool
* Update packages/react-query/package.json
* fix: track data property if `promise` is tracked
if users use the `promise` returned from useQuery, they are actually interested in the `data` it unwraps to. Since the promise doesn't change when data resolves, we would likely miss a re-render
* Revert "fix: track data property if `promise` is tracked"
This reverts commit d1184babd1.
* add test case that @tkdodo was concerned about
* tweak
* mkay
* add `useInfiniteQuery()` test
* consistent testing
* better test
* rm comment
* test resetting errror boundary
* better test
* cool
* cool
* more test
* mv cleanup
* mkay
* some more things
* add fixme
* fix types
* wat
* fixes
* revert
* fix
* colocating doesn’t workkk
* mkay
* mkay
* might work
* more test
* cool
* i don’t know hwat i’m doing
* mocky
* lint
* space
* rm log
* setIsServer
* mkay
* ffs
* remove unnecessary stufffff
* tweak more
* just naming and comments
* tweak
* fix: use fetchOptimistic util instead of observer.fetchOptimistic
* refactor: make sure to only trigger fetching during render if we really have no cache entry yet
* fix: move the `isNewCacheEntry` check before observer creation
* chore: avoid rect key warnings
* fix: add an `updateResult` for all observers to finalize currentThenable
* chore: logs during suspense errors
* fix: empty catch
* feature flag
* add comment
* simplify
* omit from suspense
* feat flag
* more tests
* test: scope experimental_promise to useQuery().promise tests
* refactor: rename to experimental_prefetchInRender
* test: more tests
* test: more cancelation
* fix cancellation
* make it work
* tweak comment
* Update packages/react-query/src/useBaseQuery.ts
* simplify code a bit
* Update packages/query-core/src/queryObserver.ts
* refactor: move experimental_prefetchInRender check until after the early bail-out
* fix: when cancelled, the promise should stay pending
* test: disabled case
* chore: no idea what's going on
* refactor: delete unnecessary check
* revert refactor i did for cancellation when we wanted it to `throw`
* add docs
* align
* tweak
* Update docs/reference/QueryClient.md
* Update docs/framework/react/reference/queryOptions.md
---------
Co-authored-by: Alex Liu <dsa1314@gmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
On https://tanstack.com/query/latest/docs/framework/react/installation for example, the Bash snippets do *not* have a leading `$` character. So you can click the clipboard and then paste these into your terminal.
Doesn't work if there's a `$ ` prefix on the bash command.
The pageParam == null bailout is meant for fetching further pages, where users can return null/undefined from getNextPageParam to stop fetching; However, after the latest refactoring, we also did this for the initial fetch. This stops fetching from working at all if the initialPageParam was set to null/undefined, which I didn't think anyone would do, but here we are.
* Add reproduction test for infinite loop retries (issue #8046)
* ci: apply automated fixes
* fix: retry for infinite queries
The retryer lives above the fetchFn, and it re-runs the fetchFn whenever a retry happens. Usually, the fetchFn is a thin wrapper around the actual queryFn passed by the user. However, for infinite queries, it fetches all pages in a loop.
The retryer breaks out of this loop if an error occurs on e.g. the second page, and then retries by running the fetchFn - which will re-set the loop
This fix hoists the currentPage counter out of the fetchFn - into the closure created by onFetch. The outer closure is created from running `query.fetch` once, so it won't be re-set between retries.
The fix also re-writes the fetch loop to always take the `currentPage` into account, where it was previously treating the first page differently
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* feat(core): ensureInfiniteQueryData
* docs: ensureInfiniteQueryData
* feat(types): make sure we can't pass infiniteQueryOptions to non-infinite query functions like fetchQuery