We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb6c6f2 commit d67605eCopy full SHA for d67605e
src/cache.js
@@ -27,13 +27,13 @@ export const createCachingMethods = ({ collection, cache }) => {
27
28
const cacheDoc = await cache.get(key)
29
if (cacheDoc) {
30
- return cacheDoc
+ return JSON.parse(cacheDoc)
31
}
32
33
const doc = await loader.load(id)
34
if (Number.isInteger(ttl)) {
35
// https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-caching#apollo-server-caching
36
- cache.set(key, doc, { ttl })
+ cache.set(key, JSON.stringify(doc), { ttl })
37
38
39
return doc
0 commit comments