@graphql-codegen/typescript 3.0.3-alpha-20230322201324-be07d4e19 → 3.0.3-alpha-20230323112934-192fd042b
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 +7 -2
- package/esm/visitor.js +6 -1
- package/package.json +3 -3
- package/typings/visitor.d.cts +3 -1
- package/typings/visitor.d.ts +3 -1
package/cjs/visitor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TsVisitor = exports.MAKE_INCREMENTAL_SIGNATURE = exports.MAKE_EMPTY_SIGNATURE = exports.MAKE_MAYBE_SIGNATURE = exports.MAKE_OPTIONAL_SIGNATURE = exports.EXACT_SIGNATURE = void 0;
|
|
3
|
+
exports.TsVisitor = exports.MAKE_INCREMENTAL_SIGNATURE = exports.MAKE_ALL_EMPTY_SIGNATURE = exports.MAKE_EMPTY_SIGNATURE = exports.MAKE_MAYBE_SIGNATURE = exports.MAKE_OPTIONAL_SIGNATURE = exports.EXACT_SIGNATURE = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
|
6
6
|
const auto_bind_1 = tslib_1.__importDefault(require("auto-bind"));
|
|
@@ -10,7 +10,8 @@ exports.EXACT_SIGNATURE = `type Exact<T extends { [key: string]: unknown }> = {
|
|
|
10
10
|
exports.MAKE_OPTIONAL_SIGNATURE = `type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };`;
|
|
11
11
|
exports.MAKE_MAYBE_SIGNATURE = `type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };`;
|
|
12
12
|
exports.MAKE_EMPTY_SIGNATURE = `type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };`;
|
|
13
|
-
exports.
|
|
13
|
+
exports.MAKE_ALL_EMPTY_SIGNATURE = `type Empty<T> = { [P in keyof T]?: never };`;
|
|
14
|
+
exports.MAKE_INCREMENTAL_SIGNATURE = `type Incremental<T> = T & { ' $defer': true };`;
|
|
14
15
|
class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
15
16
|
constructor(schema, pluginConfig, additionalConfig = {}) {
|
|
16
17
|
super(schema, pluginConfig, {
|
|
@@ -88,6 +89,7 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
88
89
|
this.getMakeOptionalDefinition(),
|
|
89
90
|
this.getMakeMaybeDefinition(),
|
|
90
91
|
this.getMakeEmptyDefinition(),
|
|
92
|
+
this.getMakeAllEmptyDefinition(),
|
|
91
93
|
this.getIncrementalDefinition(),
|
|
92
94
|
];
|
|
93
95
|
if (this.config.wrapFieldDefinitions) {
|
|
@@ -114,6 +116,9 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
114
116
|
getMakeEmptyDefinition() {
|
|
115
117
|
return `${this.getExportPrefix()}${exports.MAKE_EMPTY_SIGNATURE}`;
|
|
116
118
|
}
|
|
119
|
+
getMakeAllEmptyDefinition() {
|
|
120
|
+
return `${this.getExportPrefix()}${exports.MAKE_ALL_EMPTY_SIGNATURE}`;
|
|
121
|
+
}
|
|
117
122
|
getIncrementalDefinition() {
|
|
118
123
|
return `${this.getExportPrefix()}${exports.MAKE_INCREMENTAL_SIGNATURE}`;
|
|
119
124
|
}
|
package/esm/visitor.js
CHANGED
|
@@ -6,7 +6,8 @@ export const EXACT_SIGNATURE = `type Exact<T extends { [key: string]: unknown }>
|
|
|
6
6
|
export const MAKE_OPTIONAL_SIGNATURE = `type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };`;
|
|
7
7
|
export const MAKE_MAYBE_SIGNATURE = `type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };`;
|
|
8
8
|
export const MAKE_EMPTY_SIGNATURE = `type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };`;
|
|
9
|
-
export const
|
|
9
|
+
export const MAKE_ALL_EMPTY_SIGNATURE = `type Empty<T> = { [P in keyof T]?: never };`;
|
|
10
|
+
export const MAKE_INCREMENTAL_SIGNATURE = `type Incremental<T> = T & { ' $defer': true };`;
|
|
10
11
|
export class TsVisitor extends BaseTypesVisitor {
|
|
11
12
|
constructor(schema, pluginConfig, additionalConfig = {}) {
|
|
12
13
|
super(schema, pluginConfig, {
|
|
@@ -84,6 +85,7 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
84
85
|
this.getMakeOptionalDefinition(),
|
|
85
86
|
this.getMakeMaybeDefinition(),
|
|
86
87
|
this.getMakeEmptyDefinition(),
|
|
88
|
+
this.getMakeAllEmptyDefinition(),
|
|
87
89
|
this.getIncrementalDefinition(),
|
|
88
90
|
];
|
|
89
91
|
if (this.config.wrapFieldDefinitions) {
|
|
@@ -110,6 +112,9 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
110
112
|
getMakeEmptyDefinition() {
|
|
111
113
|
return `${this.getExportPrefix()}${MAKE_EMPTY_SIGNATURE}`;
|
|
112
114
|
}
|
|
115
|
+
getMakeAllEmptyDefinition() {
|
|
116
|
+
return `${this.getExportPrefix()}${MAKE_ALL_EMPTY_SIGNATURE}`;
|
|
117
|
+
}
|
|
113
118
|
getIncrementalDefinition() {
|
|
114
119
|
return `${this.getExportPrefix()}${MAKE_INCREMENTAL_SIGNATURE}`;
|
|
115
120
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript",
|
|
3
|
-
"version": "3.0.3-alpha-
|
|
3
|
+
"version": "3.0.3-alpha-20230323112934-192fd042b",
|
|
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.0-alpha-
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "4.2.0-alpha-20230323112934-192fd042b",
|
|
10
10
|
"@graphql-codegen/schema-ast": "^3.0.1",
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "3.1.0-alpha-
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "3.1.0-alpha-20230323112934-192fd042b",
|
|
12
12
|
"auto-bind": "~4.0.0",
|
|
13
13
|
"tslib": "~2.5.0"
|
|
14
14
|
},
|
package/typings/visitor.d.cts
CHANGED
|
@@ -21,7 +21,8 @@ export declare const EXACT_SIGNATURE = "type Exact<T extends { [key: string]: un
|
|
|
21
21
|
export declare const MAKE_OPTIONAL_SIGNATURE = "type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };";
|
|
22
22
|
export declare const MAKE_MAYBE_SIGNATURE = "type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };";
|
|
23
23
|
export declare const MAKE_EMPTY_SIGNATURE = "type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };";
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const MAKE_ALL_EMPTY_SIGNATURE = "type Empty<T> = { [P in keyof T]?: never };";
|
|
25
|
+
export declare const MAKE_INCREMENTAL_SIGNATURE = "type Incremental<T> = T & { ' $defer': true };";
|
|
25
26
|
export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeScriptPluginConfig, TParsedConfig extends TypeScriptPluginParsedConfig = TypeScriptPluginParsedConfig> extends BaseTypesVisitor<TRawConfig, TParsedConfig> {
|
|
26
27
|
constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>);
|
|
27
28
|
protected _getTypeForNode(node: NamedTypeNode): string;
|
|
@@ -30,6 +31,7 @@ export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeS
|
|
|
30
31
|
getMakeOptionalDefinition(): string;
|
|
31
32
|
getMakeMaybeDefinition(): string;
|
|
32
33
|
getMakeEmptyDefinition(): string;
|
|
34
|
+
getMakeAllEmptyDefinition(): string;
|
|
33
35
|
getIncrementalDefinition(): string;
|
|
34
36
|
getMaybeValue(): string;
|
|
35
37
|
getInputMaybeValue(): string;
|
package/typings/visitor.d.ts
CHANGED
|
@@ -21,7 +21,8 @@ export declare const EXACT_SIGNATURE = "type Exact<T extends { [key: string]: un
|
|
|
21
21
|
export declare const MAKE_OPTIONAL_SIGNATURE = "type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };";
|
|
22
22
|
export declare const MAKE_MAYBE_SIGNATURE = "type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };";
|
|
23
23
|
export declare const MAKE_EMPTY_SIGNATURE = "type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };";
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const MAKE_ALL_EMPTY_SIGNATURE = "type Empty<T> = { [P in keyof T]?: never };";
|
|
25
|
+
export declare const MAKE_INCREMENTAL_SIGNATURE = "type Incremental<T> = T & { ' $defer': true };";
|
|
25
26
|
export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeScriptPluginConfig, TParsedConfig extends TypeScriptPluginParsedConfig = TypeScriptPluginParsedConfig> extends BaseTypesVisitor<TRawConfig, TParsedConfig> {
|
|
26
27
|
constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>);
|
|
27
28
|
protected _getTypeForNode(node: NamedTypeNode): string;
|
|
@@ -30,6 +31,7 @@ export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeS
|
|
|
30
31
|
getMakeOptionalDefinition(): string;
|
|
31
32
|
getMakeMaybeDefinition(): string;
|
|
32
33
|
getMakeEmptyDefinition(): string;
|
|
34
|
+
getMakeAllEmptyDefinition(): string;
|
|
33
35
|
getIncrementalDefinition(): string;
|
|
34
36
|
getMaybeValue(): string;
|
|
35
37
|
getInputMaybeValue(): string;
|