INNER CODE UNIT · TypeScript
restructuredBody
open-source-labs/obsidian · src/Obsidian.ts:121
let restructuredBody = { query: restructure({query: queryStr}) }; // Restructure gets rid of variables and fragments from the query
// IF WE ARE USING A CACHE
if (useCache) {
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
);