@coderich/autograph 0.13.97 → 0.13.99

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.97",
4
+ "version": "0.13.99",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -26,6 +26,10 @@ module.exports = class Resolver {
26
26
  Util.set(this.#context, `${this.#schema.namespace}.resolver`, this);
27
27
  }
28
28
 
29
+ getSchema() {
30
+ return this.#schema;
31
+ }
32
+
29
33
  getContext() {
30
34
  return this.#context;
31
35
  }
@@ -15,6 +15,7 @@ module.exports = class QueryBuilder {
15
15
  this.#query = Object.defineProperties(query, {
16
16
  id: { writable: true, enumerable: true, value: query.id },
17
17
  args: { writable: true, enumerable: true, value: query.args || {} },
18
+ meta: { writable: true, enumerable: true, value: query.meta || {} },
18
19
  flags: { writable: true, enumerable: true, value: query.flags || {} },
19
20
  select: { writable: true, enumerable: true, value: query.select || Object.keys(model.fields) },
20
21
  options: { writable: true, enumerable: true, value: query.options || {} },
@@ -66,6 +66,7 @@ module.exports = class QueryResolver extends QueryBuilder {
66
66
  const args = { query: $query, resolver: this.#resolver, context: this.#context };
67
67
  const values = get(this.#model.transformers.create.transform(input, args), key, []);
68
68
  const $doc = Util.pathmap(key, doc, (arr) => {
69
+ if (arr == null) return arr;
69
70
  return arr.filter(el => values.every(v => `${v}` !== `${el}`));
70
71
  });
71
72
  return this.#resolver.match(this.#model.name).id(doc.id).save({ [key]: get($doc, key) });