@coderich/autograph 0.13.7 → 0.13.9

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.7",
4
+ "version": "0.13.9",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -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
  /**
@@ -347,6 +347,11 @@ module.exports = class Schema {
347
347
  return this.merge(Schema.#api(this.parse()));
348
348
  }
349
349
 
350
+ framework() {
351
+ this.#typeDefs = Schema.#framework(this.#config.directives);
352
+ return this;
353
+ }
354
+
350
355
  setup() {
351
356
  return Emitter.emit('setup', this.#schema);
352
357
  }
@@ -367,8 +372,10 @@ module.exports = class Schema {
367
372
 
368
373
  return parse(`
369
374
  scalar AutoGraphMixed
375
+ scalar AutoGraphDriver # DELETE WHEN MIGRATED
370
376
 
371
377
  enum AutoGraphIndexEnum { unique }
378
+ enum AutoGraphAuthzEnum { private protected public } # DELETE WHEN MIGRATED
372
379
  enum AutoGraphOnDeleteEnum { cascade nullify restrict defer }
373
380
  enum AutoGraphPipelineEnum { ${Object.keys(Pipeline).filter(k => !k.startsWith('$')).join(' ')} }
374
381
 
@@ -382,6 +389,16 @@ module.exports = class Schema {
382
389
  decorate: AutoGraphMixed # Decorator (default: "default")
383
390
  embed: Boolean # Mark this an embedded model (default false)
384
391
  persist: Boolean # Persist this model (default true)
392
+
393
+ # TEMP TO APPEASE TRANSITION
394
+ driver: AutoGraphDriver # External data driver
395
+ createdAt: String # Specify db key (default "createdAt")
396
+ updatedAt: String # Specify db key (default "updatedAt")
397
+ gqlScope: AutoGraphMixed # Dictate how GraphQL API behaves
398
+ dalScope: AutoGraphMixed # Dictate how the DAL behaves
399
+ fieldScope: AutoGraphMixed # Dictate how a FIELD may use me
400
+ authz: AutoGraphAuthzEnum # Access level used for authorization (default: private)
401
+ namespace: String # Logical grouping of models that can be globbed (useful for authz)
385
402
  ) on OBJECT | INTERFACE
386
403
 
387
404
  directive @${field}(
@@ -400,6 +417,16 @@ module.exports = class Schema {
400
417
  serialize: [AutoGraphPipelineEnum!]
401
418
  finalize: [AutoGraphPipelineEnum!]
402
419
  validate: [AutoGraphPipelineEnum!] # Alias for finalize
420
+
421
+ # TEMP TO APPEASE TRANSITION
422
+ id: String # Specify the ModelRef this field FK References
423
+ ref: AutoGraphMixed # Specify the modelRef field's name (overrides isEmbedded)
424
+ gqlScope: AutoGraphMixed # Dictate how GraphQL API behaves
425
+ dalScope: AutoGraphMixed # Dictate how the DAL behaves
426
+ fieldScope: AutoGraphMixed # Dictate how a FIELD may use me
427
+ destruct: [AutoGraphPipelineEnum!]
428
+ transform: [AutoGraphPipelineEnum!]
429
+ deserialize: [AutoGraphPipelineEnum!]
403
430
  ) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION | SCALAR
404
431
 
405
432
  directive @${link}(