forked from potsda.mn/mobilizon
yarn v1 is being deprecated and starts to have some issues Signed-off-by: Thomas Citharel <tcit@tcit.fr>
15 lines
401 B
TypeScript
15 lines
401 B
TypeScript
import { defaultDataIdFromObject, InMemoryCache } from "@apollo/client/core";
|
|
import { possibleTypes, typePolicies } from "./utils";
|
|
|
|
export const cache = new InMemoryCache({
|
|
addTypename: true,
|
|
typePolicies,
|
|
possibleTypes,
|
|
dataIdFromObject: (object: any) => {
|
|
if (object.__typename === "Address") {
|
|
return object.origin_id;
|
|
}
|
|
return defaultDataIdFromObject(object);
|
|
},
|
|
});
|