react-query-devtools Option to have Trigger Error set data to null for even better development experience
#10044
Unanswered
ColemanDunn
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to say first and foremost the react query devtools are AMAZING. This makes development so much faster and straightforward when it comes to testing and tinkering with the queries and mutations your app is making.
Want to see different data for a one off use case or testing purposes? Easy, open up the dev tools and and edit the data and see everything update real time.
Want to reset the data after that? Easy, press reset.
Want to test loading state and suspense boundaries? Easy, trigger loading.
All of these are amazing, but the dev tools seem to fall short when it comes to one thing specifically:
Trigger Errorand testing error boundaries.Somewhat related to this comment here #5956 (comment), if a
useSuspenseQueryis populated with data and later errors, it does not tigger an error boundary.Trigger Erroronly sets the status to error, so this is not a straightforward and viable option to test error boundaries. In order to do so, you have to pressTrigger Errorand manually edit the data and set it tonull.I would propose that
Trigger Erroralso sets the data to null, but I realize there would be cases with where a query has data populated while having an error state might have custom logic, so perhaps the additional button would be more desirable.Something along the following:
Perhaps the copy should be something like
Trigger Hard ErrororTrigger Error Boundary.Perhaps the color should be a different shade as well. If this is a path that can go forward I would love to open a PR!
Beta Was this translation helpful? Give feedback.
All reactions