@coderich/autograph 0.13.8 → 0.13.10

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.8",
4
+ "version": "0.13.10",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -64,7 +64,7 @@ module.exports = class Query {
64
64
  transform() {
65
65
  return Promise.all([
66
66
  this.pipeline('input', this.#query.input),
67
- this.#query.isNative ? this.#query.where : this.pipeline('where', this.#query.where),
67
+ this.#query.isNative ? this.#query.where : this.pipeline('where', this.#query.where ?? {}),
68
68
  this.pipeline('sort', this.#query.sort),
69
69
  ]).then(([input, where, sort]) => this.clone({ input, where, sort }));
70
70
  }
@@ -29,7 +29,7 @@ module.exports = class Schema {
29
29
  this.#config.directives.field ??= 'field';
30
30
  this.#config.directives.link ??= 'link';
31
31
  this.#config.directives.index ??= 'index';
32
- this.#typeDefs = Schema.#framework(this.#config.directives);
32
+ // this.#typeDefs = Schema.#framework(this.#config.directives);
33
33
  }
34
34
 
35
35
  /**
@@ -209,6 +209,14 @@ module.exports = class Schema {
209
209
  target[key] = value;
210
210
  break;
211
211
  }
212
+
213
+ // Backwards compat (deprecated)
214
+ case 'model-gqlScope': { model.crud = value; break; }
215
+ case 'model-fieldScope': { model.scope = value; break; }
216
+ case 'field-gqlScope': { field.crud = value; break; }
217
+ case 'field-fieldScope': { field.scope = value; break; }
218
+
219
+ // Pipelines
212
220
  default: {
213
221
  if (pipelines.includes(key)) {
214
222
  target.pipelines[key] = target.pipelines[key].concat(value).filter(Boolean);
@@ -347,6 +355,11 @@ module.exports = class Schema {
347
355
  return this.merge(Schema.#api(this.parse()));
348
356
  }
349
357
 
358
+ framework() {
359
+ this.#typeDefs = Schema.#framework(this.#config.directives);
360
+ return this;
361
+ }
362
+
350
363
  setup() {
351
364
  return Emitter.emit('setup', this.#schema);
352
365
  }