@coderich/autograph
Advanced tools
Comparing version 0.13.94 to 0.13.95
{ | ||
"name": "@coderich/autograph", | ||
"main": "index.js", | ||
"version": "0.13.94", | ||
"version": "0.13.95", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "access": "public" |
@@ -303,3 +303,3 @@ const { graphql } = require('graphql'); | ||
const type = query.isMutation ? 'Mutation' : 'Query'; | ||
let event = this.#createEvent(query); | ||
const event = this.#createEvent(query); | ||
@@ -309,10 +309,9 @@ return Emitter.emit(`pre${type}`, event).then(async (resultEarly) => { | ||
// if (query.crud === 'update' && Util.isEqual({ added: {}, updated: {}, deleted: {} }, Util.changeset(query.doc, query.input))) return query.doc; | ||
if (['create', 'update'].includes(query.crud)) { | ||
tquery.validate(); // Transformation sets $thunks | ||
await Promise.all([...query.input.$thunks]); | ||
event = this.#createEvent(query); | ||
await Emitter.emit('validate', event); | ||
} else { | ||
event = this.#createEvent(query); | ||
} | ||
return thunk(tquery); | ||
@@ -319,0 +318,0 @@ }).then((result) => { |
99366
2242