@coderich/autograph 0.13.3 → 0.13.5

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.3",
4
+ "version": "0.13.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -48,7 +48,8 @@ module.exports = class Resolver {
48
48
  }
49
49
 
50
50
  raw(model) {
51
- return this.toModel(model)?.source?.client?.driver(model);
51
+ model = this.toModel(model);
52
+ return model?.source?.client?.driver(model.key);
52
53
  }
53
54
 
54
55
  graphql(args) {
@@ -43,8 +43,6 @@ module.exports = class QueryBuilder {
43
43
  * For use in GraphQL resolver methods to return the "correct" response
44
44
  */
45
45
  resolve(info) {
46
- this.info(info);
47
-
48
46
  switch (getGQLReturnType(info)) {
49
47
  case 'array': return this.many();
50
48
  case 'number': return this.count();
@@ -169,6 +169,10 @@ module.exports = class Schema {
169
169
  field.isConnection = value;
170
170
  break;
171
171
  }
172
+ case 'field-validate': { // Alias for finalize
173
+ target.pipelines.finalize = target.pipelines.finalize.concat(value).filter(Boolean);
174
+ break;
175
+ }
172
176
  case 'link-by': {
173
177
  field.linkBy = value;
174
178
  field.isVirtual = true;
@@ -375,6 +379,7 @@ module.exports = class Schema {
375
379
  restruct: [AutoGraphPipelineEnum!]
376
380
  serialize: [AutoGraphPipelineEnum!]
377
381
  finalize: [AutoGraphPipelineEnum!]
382
+ validate: [AutoGraphPipelineEnum!] # Alias for finalize
378
383
  ) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION | SCALAR
379
384
 
380
385
  directive @link(