apollo-feature-requests
apollo-feature-requests copied to clipboard
writeFragment fails silently when data shape doesn't match cache exactly
A description of the problem you're trying to solve, including why you think this is a problem
Writes to the Apollo cache fail silently for a variety of reason - e.g missing __typename, can't match identifier, or some part of the object is a different shape. This leads to a lot of time spent debugging what was different between the written object, and the data already in the cache.
An overview of the suggested solution
It would be extremely helpful if Apollo gave warnings about failed cache writes, and a diff of the object against an existing object (or anything else to explain what exactly was wrong with the written data).
If the feature changes current behavior, reasons why your solution is better
This will save developers time, and help catch bugs early - before they reach users.
Having spent 2 days debugging I can confirm this is a real issue!
👋 I was curious if this is still a problem for you @andrebrantom as this is a fairly old issue.