-
-
Notifications
You must be signed in to change notification settings - Fork 181
Add throwOnError
configuration option to tanstack-query plugin
#2135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
66b995d
to
1977006
Compare
@hey-api/client-axios
@hey-api/client-fetch
@hey-api/client-next
@hey-api/client-nuxt
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/vite-plugin
commit: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2135 +/- ##
==========================================
- Coverage 21.84% 21.84% -0.01%
==========================================
Files 271 271
Lines 24969 24977 +8
Branches 865 865
==========================================
Hits 5455 5455
- Misses 19508 19516 +8
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Can you explain how this works? Are you silently swallowing errors when it's set to false? |
When
This configuration option doesn't silently swallow errors - it simply gives developers the choice to handle errors at the query level (using the With |
@johnny-mh Can you share some code with me? I'm struggling to understand how errors get captured in the query's |
I've prepared a demo example that demonstrates this use case. Please feel free to review it when convenient. Thank you! https://stackblitz.com/edit/vitejs-vite-3b8gdgjy?file=src%2FApp.tsx |
Currently, all generated queries have the
throwOnError
option set totrue
by default. This works well for new projects or when all components using these queries properly implement error boundaries.However, in cases where error boundaries are not appropriately set up, developers may need to manually remove this option from each generated query, which can be cumbersome.
This PR introduces a configuration option that allows users to control whether the
throwOnError
option should be included in generated queries, providing more flexibility for different project setups.