So using dataIdFromObject
as the following:
cache: new InMemoryCache({
dataIdFromObject: object => {
switch (object.__typename) {
case 'AppKey':
return object.appKeyId
case 'App':
return object.appId
default:
return defaultDataIdFromObject(object)
}
},
})
is some how rewriting the first object.name in appKey from app, or sometimes vice versa. For example
data.getAppKeys = [{ appKeyId: 1, name: 'My App' }, ...correctObjects]
when the backend has the key as {appKeyId: 1, name: 'myAppKey'}
. This doesn't occur when commenting out either of the case
s from dataIdFromObject
.
How can I get the cache to rewrite the correct queries?