@coderich/autograph 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/Resolver.js +3 -3
package/package.json
CHANGED
package/src/core/Resolver.js
CHANGED
|
@@ -10,7 +10,7 @@ module.exports = class Resolver {
|
|
|
10
10
|
this.models = schema.getModels();
|
|
11
11
|
this.schema = schema;
|
|
12
12
|
this.context = context;
|
|
13
|
-
this.loaders = this.models.reduce((prev, model) => prev.set(model
|
|
13
|
+
this.loaders = this.models.reduce((prev, model) => prev.set(`${model}`, new DataLoader(this, model)), new Map());
|
|
14
14
|
|
|
15
15
|
//
|
|
16
16
|
this.getSchema = () => this.schema;
|
|
@@ -62,7 +62,7 @@ module.exports = class Resolver {
|
|
|
62
62
|
if (Object.prototype.hasOwnProperty.call(where, key) && where[key] == null) return Promise.resolve(null);
|
|
63
63
|
|
|
64
64
|
//
|
|
65
|
-
return this.loaders.get(model).load(query);
|
|
65
|
+
return this.loaders.get(`${model}`).load(query);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -92,7 +92,7 @@ module.exports = class Resolver {
|
|
|
92
92
|
|
|
93
93
|
// DataLoader Proxy Methods
|
|
94
94
|
clear(model) {
|
|
95
|
-
this.loaders.get(
|
|
95
|
+
this.loaders.get(`${model}`).clearAll();
|
|
96
96
|
return this;
|
|
97
97
|
}
|
|
98
98
|
|