INNER CODE UNIT · TypeScript
resetStore
microsoft/graphitation · packages/apollo-forest-run/compat/src/core/__tests__/QueryManager/index.ts:49
export function resetStore(qm: QueryManager<any>) {
return qm.clearStore({
discardWatches: false,
}).then(() => qm.reFetchObservableQueries());
}
describe('QueryManager', () => {
// Standard "get id from object" method.
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.