INNER CODE UNIT · TypeScript
cacheQueryValue
open-source-labs/obsidian · src/Obsidian.ts:126
let cacheQueryValue = await cache.read(queryStr); // Parses query string into query key and checks cache for that key
// ON CACHE MISS
if (!cacheQueryValue) {
// QUERY THE DATABASE
const gqlResponse = await (graphql as any)(
schema,
queryStr,
resolvers,
contextResult,
body.variables || undefined,
body.operationName || undefined
);
// customIdentifier is a default param for Obsidian Router - defaults to ['__typename', '_id]
const normalizedGQLResponse = normalizeObject( // Recursively flattens an arbitrarily nested object into an objects with hash key and hashable object pairs
gqlResponse,
customIdentifier