Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dataIdFromObject: (obj) => {
let id = defaultDataIdFromObject(obj);
if (!id) {
const { __typename: typename } = obj;
switch (typename) {
case 'Comment':
return `${typename}:${obj.commentId}`;
default:
return id;
}
}
return id;
}
}