@graphql-codegen/typescript 4.0.9 → 4.1.0-alpha-20240728124515-0e7e51fbc250f3e96f346caed708834ffc0a8ddf
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 +3 -0
- package/esm/visitor.js +3 -0
- package/package.json +2 -2
- package/typings/config.d.cts +4 -0
- package/typings/config.d.ts +4 -0
- package/typings/visitor.d.cts +1 -0
- package/typings/visitor.d.ts +1 -0
package/cjs/visitor.js
CHANGED
|
@@ -30,6 +30,7 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
30
30
|
useImplementingTypes: (0, visitor_plugin_common_1.getConfigValue)(pluginConfig.useImplementingTypes, false),
|
|
31
31
|
entireFieldWrapperValue: (0, visitor_plugin_common_1.getConfigValue)(pluginConfig.entireFieldWrapperValue, 'T'),
|
|
32
32
|
wrapEntireDefinitions: (0, visitor_plugin_common_1.getConfigValue)(pluginConfig.wrapEntireFieldDefinitions, false),
|
|
33
|
+
onlyTypescriptOperationTypes: (0, visitor_plugin_common_1.getConfigValue)(pluginConfig.onlyTypescriptOperationTypes, false),
|
|
33
34
|
...additionalConfig,
|
|
34
35
|
});
|
|
35
36
|
(0, auto_bind_1.default)(this);
|
|
@@ -150,6 +151,8 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
150
151
|
return `${this.getMaybeWrapper(ancestors)}<${super.ListType(node, key, parent, path, ancestors)}>`;
|
|
151
152
|
}
|
|
152
153
|
UnionTypeDefinition(node, key, parent) {
|
|
154
|
+
if (this.config.onlyTypescriptOperationTypes)
|
|
155
|
+
return '';
|
|
153
156
|
if (this.config.onlyOperationTypes || this.config.onlyEnums)
|
|
154
157
|
return '';
|
|
155
158
|
let withFutureAddedValue = [];
|
package/esm/visitor.js
CHANGED
|
@@ -26,6 +26,7 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
26
26
|
useImplementingTypes: getConfigValue(pluginConfig.useImplementingTypes, false),
|
|
27
27
|
entireFieldWrapperValue: getConfigValue(pluginConfig.entireFieldWrapperValue, 'T'),
|
|
28
28
|
wrapEntireDefinitions: getConfigValue(pluginConfig.wrapEntireFieldDefinitions, false),
|
|
29
|
+
onlyTypescriptOperationTypes: getConfigValue(pluginConfig.onlyTypescriptOperationTypes, false),
|
|
29
30
|
...additionalConfig,
|
|
30
31
|
});
|
|
31
32
|
autoBind(this);
|
|
@@ -146,6 +147,8 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
146
147
|
return `${this.getMaybeWrapper(ancestors)}<${super.ListType(node, key, parent, path, ancestors)}>`;
|
|
147
148
|
}
|
|
148
149
|
UnionTypeDefinition(node, key, parent) {
|
|
150
|
+
if (this.config.onlyTypescriptOperationTypes)
|
|
151
|
+
return '';
|
|
149
152
|
if (this.config.onlyOperationTypes || this.config.onlyEnums)
|
|
150
153
|
return '';
|
|
151
154
|
let withFutureAddedValue = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0-alpha-20240728124515-0e7e51fbc250f3e96f346caed708834ffc0a8ddf",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating TypeScript types",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@graphql-codegen/plugin-helpers": "^5.0.4",
|
|
10
10
|
"@graphql-codegen/schema-ast": "^4.0.2",
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "5.
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "5.4.0-alpha-20240728124515-0e7e51fbc250f3e96f346caed708834ffc0a8ddf",
|
|
12
12
|
"auto-bind": "~4.0.0",
|
|
13
13
|
"tslib": "~2.6.0"
|
|
14
14
|
},
|
package/typings/config.d.cts
CHANGED
package/typings/config.d.ts
CHANGED
package/typings/visitor.d.cts
CHANGED
|
@@ -16,6 +16,7 @@ export interface TypeScriptPluginParsedConfig extends ParsedTypesConfig {
|
|
|
16
16
|
inputMaybeValue: string;
|
|
17
17
|
noExport: boolean;
|
|
18
18
|
useImplementingTypes: boolean;
|
|
19
|
+
onlyTypescriptOperationTypes: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const EXACT_SIGNATURE = "type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };";
|
|
21
22
|
export declare const MAKE_OPTIONAL_SIGNATURE = "type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };";
|
package/typings/visitor.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface TypeScriptPluginParsedConfig extends ParsedTypesConfig {
|
|
|
16
16
|
inputMaybeValue: string;
|
|
17
17
|
noExport: boolean;
|
|
18
18
|
useImplementingTypes: boolean;
|
|
19
|
+
onlyTypescriptOperationTypes: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const EXACT_SIGNATURE = "type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };";
|
|
21
22
|
export declare const MAKE_OPTIONAL_SIGNATURE = "type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };";
|