@coderich/autograph 0.13.94 → 0.13.96
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/data/Pipeline.js +2 -1
- package/src/data/Resolver.js +3 -4
- package/src/query/Query.js +1 -0
- package/src/schema/Schema.js +0 -1
package/package.json
CHANGED
package/src/data/Pipeline.js
CHANGED
|
@@ -23,7 +23,8 @@ module.exports = class Pipeline {
|
|
|
23
23
|
return Util.uvl(factory(args), args.value);
|
|
24
24
|
} catch (e) {
|
|
25
25
|
const { data = {} } = e;
|
|
26
|
-
throw Boom.boomify(e, { data
|
|
26
|
+
throw Boom.boomify(e, { data });
|
|
27
|
+
// throw Boom.boomify(e, { data: { ...args, ...data } });
|
|
27
28
|
}
|
|
28
29
|
}, 'name', { value: name });
|
|
29
30
|
|
package/src/data/Resolver.js
CHANGED
|
@@ -300,19 +300,18 @@ module.exports = class Resolver {
|
|
|
300
300
|
const tquery = $query.transform(false);
|
|
301
301
|
const query = tquery.toObject();
|
|
302
302
|
const type = query.isMutation ? 'Mutation' : 'Query';
|
|
303
|
-
|
|
303
|
+
const event = this.#createEvent(query);
|
|
304
304
|
|
|
305
305
|
return Emitter.emit(`pre${type}`, event).then(async (resultEarly) => {
|
|
306
306
|
if (resultEarly !== undefined) return resultEarly; // Nothing to validate/transform
|
|
307
307
|
// if (query.crud === 'update' && Util.isEqual({ added: {}, updated: {}, deleted: {} }, Util.changeset(query.doc, query.input))) return query.doc;
|
|
308
|
+
|
|
308
309
|
if (['create', 'update'].includes(query.crud)) {
|
|
309
310
|
tquery.validate(); // Transformation sets $thunks
|
|
310
311
|
await Promise.all([...query.input.$thunks]);
|
|
311
|
-
event = this.#createEvent(query);
|
|
312
312
|
await Emitter.emit('validate', event);
|
|
313
|
-
} else {
|
|
314
|
-
event = this.#createEvent(query);
|
|
315
313
|
}
|
|
314
|
+
|
|
316
315
|
return thunk(tquery);
|
|
317
316
|
}).then((result) => {
|
|
318
317
|
event.result = result; // backwards compat
|
package/src/query/Query.js
CHANGED
package/src/schema/Schema.js
CHANGED
|
@@ -509,7 +509,6 @@ module.exports = class Schema {
|
|
|
509
509
|
|
|
510
510
|
// Field resolution comes first (unshift)
|
|
511
511
|
thunks.unshift(($schema) => {
|
|
512
|
-
$field.parent = $model;
|
|
513
512
|
$field.model = $schema.models[$field.type];
|
|
514
513
|
$field.linkTo = $schema.models[$field.linkTo];
|
|
515
514
|
$field.crud = Util.uvl($field.crud, $field.model?.scope, 'crud');
|