* feat(query-core): made "shouldThrowError" function
* refactor(react-query): apply "shouldThrowError" function in react-query package
* refactor(angular-query-experimental): apply "shouldThrowError" function
* refactor(solid-query): apply "shouldThrowError" function
* refactor(vue-query): apply "shouldThrowError" function
* test: add shouldThrowError function test
This is useful for example in thin app shell applications where feature teams provide their dependencies on lazy loaded route providers while still allowing to easily share a QueryClient.
This way the main bundle for the app shell does not include TanStack Query.
The previous suspense example incorrectly rendered null instead of the
fallback UI. This change moves the null check outside the Suspense
component to ensure the fallback is displayed as expected.
Fixes#9019
* test(query-test-utils): init
* refactor(tests): replace createQueryClient with new QueryClient instantiation across test files
* refactor(tests): remove unused imports in utils test file
* refactor(tests): replace fetcher functions with sleep-based implementations in query tests
* refactor(tests): replace simpleFetcher with sleep-based implementations in query tests
* fix(query-core): update test:build script to remove pnpm prefix
* refactor(tests): extract query function into a variable for clarity in useQuery tests
* chore(tsconfig): remove temporary Vitest TypeScript configuration file
* chore: add @tanstack/query-test-utils as a devDependency in multiple packages
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* fix(react-query): fix no error on wrong type annotation
* test(react-query): remove an unused var
* feat: use NoInfer from query-core
* ci: apply automated fixes
* fix: fix eslint error (disable)
---------
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix(types): useSuspenseQuery should type-narrow the Error field
* Update packages/query-core/src/types.ts
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
* Update packages/query-core/src/types.ts
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
* ref: use DistributiveOmit from query-core in vue-query
* chore: fix type error in tests
---------
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
* fix(solid-query): client() doesn't return undefined
* fix: (query-broadcast-client-experimental) - removing query from one tab doesn't remove it from all tabs
* fix: (query-broadcast-client-experimental) - removing query from one tab doesn't remove it from all tabs
* isolated tests
* chore: add test config
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* fix(vue-query): more specific function overloads for queryOptions and useQuery to come before general ones (#9069)
This instructs TypeScript to pick correct function overload when initialData is defined.
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>