[React Query] option to allow responses with both { data: TData, errors?: Array<TError> }
See original GitHub issueLoving the react-query codegen plugin, thank you very much!
As we know, graphql returns { data, errors }
– the custom fetcher seems to force us to resolve just data or throw just errors, but we could have some successful data, and maybe one field resolver error.
Is it possible for this to be an option so we can see successful data as well as errors? I only throw if !!errors && data === null
, or maybe i never even want to throw if its a 200 from graphql (aside from bad input, invalid auth, timeout, etc.)
Or is it even possible for the generated code to determine the return types from the custom fetcher?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dotansimha Do you know if there is any update on this?
👋 Something that can be done with graphql-request (if you don’t wnat to use rawRequest for whatever reason) is check for data in the error response and return that
i.e.
If no one else has bandwidth, might be able to take this up this weekend