@graphql-codegen/typescript-operations 3.0.2-alpha-20230217094942-ea4838cdc → 3.0.2-rc-20230227151307-971a95fb5
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.
|
@@ -26,9 +26,10 @@ class TypeScriptSelectionSetProcessor extends visitor_plugin_common_1.BaseSelect
|
|
|
26
26
|
const avoidOptional =
|
|
27
27
|
// TODO: check type and exec only if relevant
|
|
28
28
|
this.config.avoidOptionals === true ||
|
|
29
|
-
this.config.avoidOptionals
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
(typeof this.config.avoidOptionals === 'object' &&
|
|
30
|
+
(this.config.avoidOptionals.field ||
|
|
31
|
+
this.config.avoidOptionals.inputValue ||
|
|
32
|
+
this.config.avoidOptionals.object));
|
|
32
33
|
const transform = avoidOptional ? 'MakeMaybe' : 'MakeOptional';
|
|
33
34
|
resString = `${this.config.namespacedImportName ? `${this.config.namespacedImportName}.` : ''}${transform}<${resString}, ${conditilnalsList.map(field => `'${field}'`).join(' | ')}>`;
|
|
34
35
|
}
|
|
@@ -23,9 +23,10 @@ export class TypeScriptSelectionSetProcessor extends BaseSelectionSetProcessor {
|
|
|
23
23
|
const avoidOptional =
|
|
24
24
|
// TODO: check type and exec only if relevant
|
|
25
25
|
this.config.avoidOptionals === true ||
|
|
26
|
-
this.config.avoidOptionals
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
(typeof this.config.avoidOptionals === 'object' &&
|
|
27
|
+
(this.config.avoidOptionals.field ||
|
|
28
|
+
this.config.avoidOptionals.inputValue ||
|
|
29
|
+
this.config.avoidOptionals.object));
|
|
29
30
|
const transform = avoidOptional ? 'MakeMaybe' : 'MakeOptional';
|
|
30
31
|
resString = `${this.config.namespacedImportName ? `${this.config.namespacedImportName}.` : ''}${transform}<${resString}, ${conditilnalsList.map(field => `'${field}'`).join(' | ')}>`;
|
|
31
32
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-operations",
|
|
3
|
-
"version": "3.0.2-
|
|
3
|
+
"version": "3.0.2-rc-20230227151307-971a95fb5",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments",
|
|
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.2-
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "3.0.2-
|
|
10
|
+
"@graphql-codegen/typescript": "3.0.2-rc-20230227151307-971a95fb5",
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "3.0.2-rc-20230227151307-971a95fb5",
|
|
12
12
|
"auto-bind": "~4.0.0",
|
|
13
13
|
"tslib": "~2.5.0"
|
|
14
14
|
},
|