Skip to content

Conversation

@Garbanas
Copy link
Contributor

Enables the throwOnError configuration option for useQuery.refetch that has as of yet only been present in the documentation but not in the code.
Also returns the result of the fetch for consistency.

Relates to: #903 #843

…ch fails

Enables the `throwOnError` configuration option for `useQuery.refetch` that has
as of yet only been present in the documentation but not in the code.

Relates to: TanStack#903 TanStack#843
@vercel
Copy link

vercel bot commented Aug 21, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tannerlinsley/react-query/rokvt4lwi
✅ Preview: https://react-query-git-fork-garbanas-feature-843-use-query-refetch.tannerlinsley.vercel.app

}

async refetch(): Promise<void> {
async refetch(options?: { throwOnError?: boolean }): Promise<TResult | undefined> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe create a type like RefetchOptions to prevent some duplication?

@boschni
Copy link
Collaborator

boschni commented Aug 21, 2020

Related discussion: #901

@tannerlinsley tannerlinsley merged commit 2ff6041 into TanStack:master Aug 23, 2020
@tannerlinsley
Copy link
Member

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants