@coderich/autograph 0.13.90 → 0.13.91
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/query/QueryBuilder.js +12 -11
package/package.json
CHANGED
|
@@ -220,17 +220,18 @@ module.exports = class QueryBuilder {
|
|
|
220
220
|
const { id, limit } = this.#query;
|
|
221
221
|
const suffix = id || limit === 1 || (crud === 'create' && args.length < 2) ? 'One' : 'Many';
|
|
222
222
|
const op = `${crud}${suffix}`;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
op
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
input
|
|
232
|
-
|
|
233
|
-
|
|
223
|
+
const key = `${crud}${this.#query.model}`;
|
|
224
|
+
const $crud = ['push', 'pull', 'splice'].includes(crud) ? 'update' : crud;
|
|
225
|
+
let input;
|
|
226
|
+
|
|
227
|
+
if (['create', 'update'].includes($crud)) {
|
|
228
|
+
input = op === 'createMany' ? args : args[0];
|
|
229
|
+
if (input === undefined) input = {};
|
|
230
|
+
if (id !== undefined) input.id = id;
|
|
231
|
+
this.#query.args.input = input;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return this.terminate(Object.assign(this.#query, { op, key, crud: $crud, input, isMutation: true }));
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
#propCheck(prop, ...checks) {
|