mirror of
https://github.com/vale981/grapher
synced 2025-03-05 09:31:42 -05:00
performance fixes
This commit is contained in:
parent
6974ea17be
commit
7a7a147794
2 changed files with 5 additions and 5 deletions
|
@ -180,11 +180,13 @@ function snapBackCaches(node) {
|
|||
// process stuff
|
||||
_.each(node.snapCaches, (linkName, cacheField) => {
|
||||
const isSingle = _.contains(node.snapCachesSingles, cacheField);
|
||||
const linker = node.collection.getLinker(linkName);
|
||||
// we do this because for one direct and one meta direct, id is not stored
|
||||
const shoudStoreLinkStorage = !linker.isMany() && !linker.isVirtual();
|
||||
|
||||
node.results.forEach(result => {
|
||||
if (result[cacheField]) {
|
||||
const linker = node.collection.getLinker(linkName);
|
||||
|
||||
if (!linker.isMany() && !linker.isVirtual()) {
|
||||
if (shoudStoreLinkStorage) {
|
||||
Object.assign(result[cacheField], {
|
||||
_id: linker.isMeta()
|
||||
? result[linker.linkStorageField]._id
|
||||
|
|
|
@ -41,8 +41,6 @@ describe('Query Link Cache', function () {
|
|||
assert.isObject(post.author);
|
||||
assert.isString(post.author._id);
|
||||
|
||||
console.log(post.author);
|
||||
|
||||
unstubFind(Authors);
|
||||
|
||||
// now that we specify an additional field, it should bypass the cache
|
||||
|
|
Loading…
Add table
Reference in a new issue