Skip to content

Commit

Permalink
Use apq prefix for persisted query caching
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnwalraven committed Jul 10, 2018
1 parent 9e60f42 commit f551e2b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/apollo-server-core/src/runHttpQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ export async function runHttpQuery(

if (queryString === undefined) {
queryString =
(await optionsObject.persistedQueries.cache.get(sha)) || undefined;
(await optionsObject.persistedQueries.cache.get(`apq:${sha}`)) ||
undefined;
if (queryString) {
persistedQueryHit = true;
} else {
Expand Down Expand Up @@ -246,7 +247,10 @@ export async function runHttpQuery(
// We do not wait on the cache storage to complete
return (
optionsObject.persistedQueries &&
optionsObject.persistedQueries.cache.set(sha, queryString)
optionsObject.persistedQueries.cache.set(
`apq:${sha}`,
queryString,
)
);
})().catch(error => {
console.warn(error);
Expand Down

0 comments on commit f551e2b

Please sign in to comment.