I’m trying to write a type policy that will handle skipping stale updates to certain objects in our cache. Essentially, sometimes the API may provide us an object with a lastUpdated value older than the existing item. I thought I could use the type policy API to configure this but it doesn’t seem to provide enough granularity.
We have:
Scenario: {
merge: mergeScenTest4,
},
for a Scenario object that is { lastUpdated: string, id: string, name: string }
The problem I’ve hit is that when mergeScenTest4 is called, all I get for existing/incoming are refs:
which isn’t super useful since I don’t have the incoming lastUpdated field on hand to make the decision. Is it possible to get the behavior I’m after using type policies?