-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix incorrect documentation on error handling #4237
Conversation
The documentation on `errorPolicy` was incorrect with respect to the way errors are cached. This updates the docs for parity with Apollo's current functionality.
The above PRs have some additional information on this missing functionality. |
Thanks for submitting this PR @tobobo. The docs are correct however. The errors aren't stored in the data store part of the Apollo Cache, but they are stored in the query store part of the cache. The issues associated with this PR are bugs that need to be addressed. Thanks again! |
Thanks for the reply and clarification @hwillson ! Under what circumstances would these errors be retrieved from the cache? I've made a minimal reproduction of the behavior I've encountered which I believe demonstrates that the documentation here is confusing if not incorrect. https://codesandbox.io/s/qqqzp95vq9 The gist of the issue is demonstrated here:
The first result has the error thrown in the resolver, but the second result has no errors at all, which could cause problems if a particular error UI needs to be rendered in response to the error. Is there something specific that must be done for the errors to be retrieved from the query store? If so, perhaps the documentation should be updated to clarify how to achieve this. |
@tobobo Is this still an issue? Every thread/issue i read about this does not have a clear solution or explanation. |
@joepuzzo I've just updated the sandbox above to use the latest versions of all packages and the errors still persist. @hwillson are there any updates on this? The functionality still seems to differ pretty clearly from what's mentioned in the docs, which will be confusing for anyone interested in trying different error policies. |
Got to say, this phrasing had me going around in circles too. Can we update the docs ? |
The documentation on
errorPolicy
was incorrect with respect to the way errors are cached. This updates the docs for parity with Apollo's current functionality.Fixing this so that future developers do not spend too much time trying to figure out why error cacheing isn't working for them.