Closed karan2227 closed 7 months ago
We are using functions like writeFragment, writeQuery etc to update the cache. Now if in case there is some variable mismatch with the underlying mutation/query then cache write fails. This used to give a warning but now the new version of apollo package we are seeing these errors.
Question: we want to know if we can programmatically apply a common wrapper function to capture all such errors while using the functions writeFragment, writeQuery, cache.modify
.
any other way apart from console error, to catch these cache write failures of optimistic response object.
Unfortunately no we don't have any kind of universal or global handler that you can use when using these APIs directly. try
/catch
is your best best for error cases.
If this is something of interest, do you mind filing a feature request with some more detail on what you're looking for?
I'm going to go ahead and close this. Again, feel free to open up a feature request if you're interested in seeing something like this. Thanks!
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.
Hey @karan2227 👋
Would you mind providing a bit more context on what you're looking for? I'm not sure I have enough to go on with just the title alone.