@coderich/autograph 0.10.15 → 0.10.16
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 +2 -2
- package/src/data/Model.js +1 -1
- package/src/driver/MongoDriver.js +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderich/autograph",
|
|
3
3
|
"author": "Richard Livolsi (coderich)",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.16",
|
|
5
5
|
"description": "AutoGraph",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"graphql",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"ratchet": "ratchet"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@coderich/util": "^0.1.
|
|
33
|
+
"@coderich/util": "^0.1.1",
|
|
34
34
|
"@hapi/boom": "^9.1.0",
|
|
35
35
|
"dataloader": "^2.0.0",
|
|
36
36
|
"deepmerge": "^4.2.2",
|
package/src/data/Model.js
CHANGED
|
@@ -178,7 +178,7 @@ module.exports = class extends Model {
|
|
|
178
178
|
if (toFlat && get(doc, to) && field.getModelRef()) {
|
|
179
179
|
const val = prev[to];
|
|
180
180
|
delete prev[to];
|
|
181
|
-
Object.assign(prev, flatten({ [to]: val }, { safe: true }));
|
|
181
|
+
Object.assign(prev, flatten({ [to]: val }, { safe: true, depth: 1 }));
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
return prev;
|
|
@@ -72,7 +72,7 @@ module.exports = class MongoDriver {
|
|
|
72
72
|
|
|
73
73
|
updateOne({ model, where, $doc, options, flags }) {
|
|
74
74
|
const $update = { $set: $doc };
|
|
75
|
-
return this.query(model, 'updateOne', where, $update, options, flags).then(() => unflatten($doc));
|
|
75
|
+
return this.query(model, 'updateOne', where, $update, options, flags).then(() => unflatten($doc, { safe: true }));
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
deleteOne({ model, where, options, flags }) {
|