graphql-norm-stale
Version:
Staleness tracking for normalized GraphQL responses
12 lines (11 loc) • 486 B
TypeScript
import { NormMap, FieldsMap } from "graphql-norm";
/**
* Checks if any of the provided fields are stale
*/
export declare function isStale(staleMap: FieldsMap, fields: FieldsMap): boolean;
/**
* Removes the stale flag for fields that are present in the normalized result.
* Returns tupe of new map of stale fields with the cleared fields removed and
* map of the cleared fields
*/
export declare function clearStale(normMap: NormMap, staleMap: FieldsMap): [FieldsMap, FieldsMap];