Skip to content

Commit

Permalink
chore(event): added an event to register initial query cache events
Browse files Browse the repository at this point in the history
  • Loading branch information
asalem1 committed Jul 27, 2020
1 parent b881a55 commit f40e5dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/src/shared/apis/queryCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,13 @@ export const getCachedResultsOrRunQuery = (
query: string,
state: AppState
): CancelBox<RunQueryResult> => {
const queryID = `${hashCode(query)}`
event('Starting Query Cache Process ', {context: 'queryCache', queryID})
const usedVars = filterUnusedVarsBasedOnQuery(getAllVariables(state), [query])
const variables = sortBy(usedVars, ['name'])
const simplifiedVariables = variables.map(v => asSimplyKeyValueVariables(v))
const stringifiedVars = JSON.stringify(simplifiedVariables)
// create the queryID based on the query & vars
const queryID = `${hashCode(query)}`
const hashedVariables = `${hashCode(stringifiedVars)}`

const cacheResults: RunQueryResult | null = queryCache.getFromCache(
Expand Down

0 comments on commit f40e5dc

Please sign in to comment.