INNER CODE UNIT · TypeScript
normalizedGQLResponse
open-source-labs/obsidian · src/Obsidian.ts:141
const normalizedGQLResponse = normalizeObject( // Recursively flattens an arbitrarily nested object into an objects with hash key and hashable object pairs
gqlResponse,
customIdentifier
);
// If operation is mutation, invalidate relevant responses in cache
if (isMutation(restructuredBody)) {
invalidateCache(normalizedGQLResponse, queryStr, mutationTableMap);
// ELSE, simply write to the cache
} else {
await cache.write(queryStr, normalizedGQLResponse, searchTerms);
}
// AFTER HANDLING THE CACHE, RETURN THE ORIGINAL RESPONSE
response.status = 200;
response.body = gqlResponse;
return;
// ON CACHE HIT
} else {