INNER CODE UNIT · TypeScript
dataIdFromObject
microsoft/graphitation · packages/apollo-forest-run/compat/src/core/__tests__/QueryManager/index.ts:57
const dataIdFromObject = (object: any) => {
if (object.__typename && object.id) {
return object.__typename + '__' + object.id;
}
return undefined;
};
// Helper method that serves as the constructor method for
// QueryManager but has defaults that make sense for these
// tests.
const createQueryManager = ({
link,
config = {},
clientAwareness = {},
queryDeduplication = false,
}: {
link: ApolloLink;
config?: Partial<InMemoryCacheConfig>;