Can you return both data and errors for the initial request? #3176
-
With graphql, it's possible for a response to contain both data and errors at the same time. Right now, if a background refetch of a query fails, that query then goes into a state where both its Apollo has something similar if you set the error policy of a query to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't see how its currently possible, because react-query needs a resolved or rejected promise to go into success or error state. You could do it in user-land by:
but react-query will not go into error state then, so there won't be retries for example. |
Beta Was this translation helpful? Give feedback.
I don't see how its currently possible, because react-query needs a resolved or rejected promise to go into success or error state. You could do it in user-land by:
data
and move the related errors to a separateerror
field that you can then return from your custom hook.but react-query will not go into error state then, so there won't be retries for example.