diff --git a/lib/links/linkTypes/base.js b/lib/links/linkTypes/base.js index 2662b43..fbf8946 100644 --- a/lib/links/linkTypes/base.js +++ b/lib/links/linkTypes/base.js @@ -58,9 +58,14 @@ export default class Link { let appliedFilters = _.extend({}, filters, searchFilters); - // I'm sorry. // see https://github.com/cult-of-coders/grapher/issues/134 - return (linkedCollection.find && linkedCollection.find(appliedFilters, options, userId)) || linkedCollection.default.find(appliedFilters, options, userId); + // happens due to recursive importing of modules + // TODO: find another way to do this + if (linkedCollection.find) { + return linkedCollection.find(appliedFilters, options, userId) + } else { + return linkedCollection.default.find(appliedFilters, options, userId); + } } /** diff --git a/lib/query/lib/createGraph.js b/lib/query/lib/createGraph.js index c7e565c..6edf96e 100644 --- a/lib/query/lib/createGraph.js +++ b/lib/query/lib/createGraph.js @@ -31,7 +31,8 @@ export function createNodes(root) { } // workaround, see https://github.com/cult-of-coders/grapher/issues/134 - if(root.collection.default) { + // TODO: find another way to do this + if (root.collection.default) { root.collection = root.collection.default; }