@coderich/autograph 0.13.18 → 0.13.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderich/autograph",
3
3
  "main": "index.js",
4
- "version": "0.13.18",
4
+ "version": "0.13.19",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -201,7 +201,7 @@ module.exports = class Resolver {
201
201
  const currSession = this.#sessions.slice(-1).pop();
202
202
 
203
203
  if (oquery.isMutation) {
204
- thunk = () => model.source.client.resolve(tquery.toDriver().toObject()).then((results = oquery.doc) => {
204
+ thunk = () => model.source.client.resolve(tquery.toDriver().toObject()).then((results) => {
205
205
  // We clear the cache immediately (regardless if we're in transaction or not)
206
206
  this.clear(model);
207
207
 
@@ -209,7 +209,7 @@ module.exports = class Resolver {
209
209
  currSession?.thunks.push(...this.#sessions.map(s => () => s.parent.clear(model)));
210
210
 
211
211
  // Return results
212
- return results;
212
+ return oquery.crud === 'delete' ? oquery.doc : results;
213
213
  });
214
214
  } else {
215
215
  thunk = () => this.#dataLoaders[model].resolve(tquery);
@@ -218,7 +218,7 @@ module.exports = class Resolver {
218
218
  return this.#createSystemEvent(tquery, () => {
219
219
  return thunk().then((result) => {
220
220
  if (oquery.flags?.required && (result == null || result?.length === 0)) throw Boom.notFound();
221
- return this.toResultSet(model, result, tquery.toObject());
221
+ return oquery.crud === 'delete' ? result : this.toResultSet(model, result);
222
222
  });
223
223
  });
224
224
  }