* fix(query-core) export Mutation class instead of exporting it as a type
previously, attempting to create a Mutation in a vanilla JS project required the use of the Mutation class constructor but due to it being exported as a type, we run into a runtime error stating that the Mutation type is not a class resulting in us not being able to proceed despite the compilation process in TypeScript not throwing an issue. This change exposes the class instead of the type in order to accomodate this requirement in vanilla JS projects
fixes `Mutation` class isn't exposed from @tanstack/query-core #7785
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
The `fetchPage` function has a safeguard where it only returns the current data if pageParam == null, however, this means we still stay in the loop and call `getNextPageParam` unnecessarily.
This can be troublesome if you set `pages: Infinity` on queryClient.fetchInfiniteQuery to fetch an arbitrary amount of pages until the natural end is reached by returning null/undefined from getNextPageParam, because it would never actually escape the loop
* refactor(react-query): add error message for skipToken in useSuspenseQueries
* refactor(react-query): add error message for skipToken in useSuspenseInfiniteQuery
* Throw error or mutation doesn't see any the 500 coming from API
* fix: prettier
* ci: apply automated fixes
---------
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): allow function value of `notifyOnChangeProps` query option to return `undefined`
`undefined` is a valid return value for the function value of `notifyOnChangeProps`. See linked issue for more details.
Fixes#7426.
* docs(react-query): update signature of `useQuery`'s `notifyOnChangeProps` option
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* fix(query-core): widen QueriesObserver queries type (#7446)
Widen the `QueriesObserver` queries type so we can assign `UseQueryOptions` to `QueryObserverOptions`.
The result from the `queryOptions` helper can now be passed to `QueriesObserver`.
* chore: prettier
* fix(types): QueryKey needs to default to `any`, too
---------
Co-authored-by: Yannick CROISSANT <yannick.croissant@canal-plus.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* chore: update Streaming with Server Components docs to reflect correct usage
* chore: update Streaming with Server Components to show moving the getQueryClient function
* chore: fix prettier styling
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* refactor: Changed parameter names to match those in other sleep utility functions.
* refactor: Most utility functions are defined as regular functions, updated this one to match.
* fix: formatting