@graphql-codegen/typescript 3.1.0-alpha-20230516085445-9f9bc9b8f → 3.1.0-alpha-20230524075119-c809c0b26
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 -3
- package/esm/visitor.js +3 -3
- package/package.json +3 -3
- package/typings/visitor.d.cts +1 -1
- package/typings/visitor.d.ts +1 -1
package/cjs/visitor.js
CHANGED
|
@@ -42,7 +42,7 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
42
42
|
ignoreExport: this.config.noExport,
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
_getTypeForNode(node
|
|
45
|
+
_getTypeForNode(node) {
|
|
46
46
|
const typeAsString = node.name;
|
|
47
47
|
if (this.config.useImplementingTypes) {
|
|
48
48
|
const allTypesMap = this._schema.getTypeMap();
|
|
@@ -60,7 +60,7 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
60
60
|
return implementingTypes.join(' | ');
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
const typeString = super._getTypeForNode(node
|
|
63
|
+
const typeString = super._getTypeForNode(node);
|
|
64
64
|
const schemaType = this._schema.getType(node.name);
|
|
65
65
|
if ((0, graphql_1.isEnumType)(schemaType)) {
|
|
66
66
|
// futureProofEnums + enumsAsTypes combination adds the future value to the enum type itself
|
|
@@ -160,7 +160,7 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
160
160
|
}
|
|
161
161
|
const originalNode = parent[key];
|
|
162
162
|
const possibleTypes = originalNode.types
|
|
163
|
-
.map(t => (this.scalars[t.name.value] ? this._getScalar(t.name.value
|
|
163
|
+
.map(t => (this.scalars[t.name.value] ? this._getScalar(t.name.value) : this.convertName(t)))
|
|
164
164
|
.concat(...withFutureAddedValue)
|
|
165
165
|
.join(' | ');
|
|
166
166
|
return new visitor_plugin_common_1.DeclarationBlock(this._declarationBlockConfig)
|
package/esm/visitor.js
CHANGED
|
@@ -38,7 +38,7 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
38
38
|
ignoreExport: this.config.noExport,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
_getTypeForNode(node
|
|
41
|
+
_getTypeForNode(node) {
|
|
42
42
|
const typeAsString = node.name;
|
|
43
43
|
if (this.config.useImplementingTypes) {
|
|
44
44
|
const allTypesMap = this._schema.getTypeMap();
|
|
@@ -56,7 +56,7 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
56
56
|
return implementingTypes.join(' | ');
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
const typeString = super._getTypeForNode(node
|
|
59
|
+
const typeString = super._getTypeForNode(node);
|
|
60
60
|
const schemaType = this._schema.getType(node.name);
|
|
61
61
|
if (isEnumType(schemaType)) {
|
|
62
62
|
// futureProofEnums + enumsAsTypes combination adds the future value to the enum type itself
|
|
@@ -156,7 +156,7 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
156
156
|
}
|
|
157
157
|
const originalNode = parent[key];
|
|
158
158
|
const possibleTypes = originalNode.types
|
|
159
|
-
.map(t => (this.scalars[t.name.value] ? this._getScalar(t.name.value
|
|
159
|
+
.map(t => (this.scalars[t.name.value] ? this._getScalar(t.name.value) : this.convertName(t)))
|
|
160
160
|
.concat(...withFutureAddedValue)
|
|
161
161
|
.join(' | ');
|
|
162
162
|
return new DeclarationBlock(this._declarationBlockConfig)
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript",
|
|
3
|
-
"version": "3.1.0-alpha-
|
|
3
|
+
"version": "3.1.0-alpha-20230524075119-c809c0b26",
|
|
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"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "4.2.1-alpha-
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "4.2.1-alpha-20230524075119-c809c0b26",
|
|
10
10
|
"@graphql-codegen/schema-ast": "^3.0.1",
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "3.2.0-alpha-
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "3.2.0-alpha-20230524075119-c809c0b26",
|
|
12
12
|
"auto-bind": "~4.0.0",
|
|
13
13
|
"tslib": "~2.5.0"
|
|
14
14
|
},
|
package/typings/visitor.d.cts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const MAKE_EMPTY_SIGNATURE = "type MakeEmpty<T extends { [key: st
|
|
|
24
24
|
export declare const MAKE_INCREMENTAL_SIGNATURE = "type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };";
|
|
25
25
|
export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeScriptPluginConfig, TParsedConfig extends TypeScriptPluginParsedConfig = TypeScriptPluginParsedConfig> extends BaseTypesVisitor<TRawConfig, TParsedConfig> {
|
|
26
26
|
constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>);
|
|
27
|
-
protected _getTypeForNode(node: NamedTypeNode
|
|
27
|
+
protected _getTypeForNode(node: NamedTypeNode): string;
|
|
28
28
|
getWrapperDefinitions(): string[];
|
|
29
29
|
getExactDefinition(): string;
|
|
30
30
|
getMakeOptionalDefinition(): string;
|
package/typings/visitor.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const MAKE_EMPTY_SIGNATURE = "type MakeEmpty<T extends { [key: st
|
|
|
24
24
|
export declare const MAKE_INCREMENTAL_SIGNATURE = "type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };";
|
|
25
25
|
export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeScriptPluginConfig, TParsedConfig extends TypeScriptPluginParsedConfig = TypeScriptPluginParsedConfig> extends BaseTypesVisitor<TRawConfig, TParsedConfig> {
|
|
26
26
|
constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>);
|
|
27
|
-
protected _getTypeForNode(node: NamedTypeNode
|
|
27
|
+
protected _getTypeForNode(node: NamedTypeNode): string;
|
|
28
28
|
getWrapperDefinitions(): string[];
|
|
29
29
|
getExactDefinition(): string;
|
|
30
30
|
getMakeOptionalDefinition(): string;
|