@quell/server
Version:
Quell is an open-source NPM package providing a light-weight caching layer implementation and cache invalidation for GraphQL responses on both the client- and server-side. Use Quell to prevent redundant client-side API requests and to minimize costly serv
16 lines (15 loc) • 510 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeNode = void 0;
const cacheUtils_1 = require("./cacheUtils");
function normalizeNode(key, value, proto, parentName, map) {
const cacheID = (0, cacheUtils_1.getCacheID)(proto, map);
const payload = {};
for (const field in value) {
if (field.includes("__"))
continue;
payload[field] = value[field];
}
return { cacheID, payload };
}
exports.normalizeNode = normalizeNode;