@graphql-codegen/typescript-resolvers 3.1.0 → 3.1.1-alpha-20230228174037-1a41e74f9

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/cjs/visitor.js CHANGED
@@ -32,8 +32,10 @@ class TypeScriptResolversVisitor extends visitor_plugin_common_1.BaseResolversVi
32
32
  return `ParentType extends ${parentType} = ${parentType}`;
33
33
  }
34
34
  formatRootResolver(schemaTypeName, resolverType, declarationKind) {
35
- var _a, _b;
36
- const avoidOptionals = (_b = (_a = this.config.avoidOptionals) === null || _a === void 0 ? void 0 : _a.resolvers) !== null && _b !== void 0 ? _b : this.config.avoidOptionals === true;
35
+ var _a;
36
+ const avoidOptionals = typeof this.config.avoidOptionals === 'object'
37
+ ? (_a = this.config.avoidOptionals) === null || _a === void 0 ? void 0 : _a.resolvers
38
+ : !!this.config.avoidOptionals === true;
37
39
  return `${schemaTypeName}${avoidOptionals ? '' : '?'}: ${resolverType}${this.getPunctuation(declarationKind)}`;
38
40
  }
39
41
  clearOptional(str) {
package/esm/visitor.js CHANGED
@@ -28,8 +28,10 @@ export class TypeScriptResolversVisitor extends BaseResolversVisitor {
28
28
  return `ParentType extends ${parentType} = ${parentType}`;
29
29
  }
30
30
  formatRootResolver(schemaTypeName, resolverType, declarationKind) {
31
- var _a, _b;
32
- const avoidOptionals = (_b = (_a = this.config.avoidOptionals) === null || _a === void 0 ? void 0 : _a.resolvers) !== null && _b !== void 0 ? _b : this.config.avoidOptionals === true;
31
+ var _a;
32
+ const avoidOptionals = typeof this.config.avoidOptionals === 'object'
33
+ ? (_a = this.config.avoidOptionals) === null || _a === void 0 ? void 0 : _a.resolvers
34
+ : !!this.config.avoidOptionals === true;
33
35
  return `${schemaTypeName}${avoidOptionals ? '' : '?'}: ${resolverType}${this.getPunctuation(declarationKind)}`;
34
36
  }
35
37
  clearOptional(str) {
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-resolvers",
3
- "version": "3.1.0",
3
+ "version": "3.1.1-alpha-20230228174037-1a41e74f9",
4
4
  "description": "GraphQL Code Generator plugin for generating TypeScript types for resolvers signature",
5
5
  "peerDependencies": {
6
6
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
7
7
  },
8
8
  "dependencies": {
9
9
  "@graphql-codegen/plugin-helpers": "^4.1.0",
10
- "@graphql-codegen/typescript": "^3.0.1",
11
- "@graphql-codegen/visitor-plugin-common": "3.0.1",
10
+ "@graphql-codegen/typescript": "3.0.2-alpha-20230228174037-1a41e74f9",
11
+ "@graphql-codegen/visitor-plugin-common": "3.0.2-alpha-20230228174037-1a41e74f9",
12
12
  "@graphql-tools/utils": "^9.0.0",
13
13
  "auto-bind": "~4.0.0",
14
14
  "tslib": "~2.5.0"