apollo-feature-requests icon indicating copy to clipboard operation
apollo-feature-requests copied to clipboard

writeFragment fails silently when data shape doesn't match cache exactly

Open mattlevine32 opened this issue 5 years ago • 2 comments

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.

mattlevine32 avatar Aug 10 '20 22:08 mattlevine32

Having spent 2 days debugging I can confirm this is a real issue!

andrebrantom avatar Nov 26 '21 10:11 andrebrantom

👋 I was curious if this is still a problem for you @andrebrantom as this is a fairly old issue.

jpvajda avatar Jul 26 '22 23:07 jpvajda