@graphql-codegen/typescript 3.0.4-alpha-20230420202418-82620d460 → 3.0.4-alpha-20230421074125-e883aa652
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 +1 -11
- package/esm/visitor.js +0 -10
- package/package.json +2 -2
- package/typings/visitor.d.cts +0 -4
- package/typings/visitor.d.ts +0 -4
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.
|
|
3
|
+
exports.TsVisitor = 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"));
|
|
@@ -9,8 +9,6 @@ const typescript_variables_to_object_js_1 = require("./typescript-variables-to-o
|
|
|
9
9
|
exports.EXACT_SIGNATURE = `type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };`;
|
|
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
|
-
exports.MAKE_EMPTY_SIGNATURE = `type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };`;
|
|
13
|
-
exports.MAKE_INCREMENTAL_SIGNATURE = `type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };`;
|
|
14
12
|
class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
15
13
|
constructor(schema, pluginConfig, additionalConfig = {}) {
|
|
16
14
|
super(schema, pluginConfig, {
|
|
@@ -87,8 +85,6 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
87
85
|
this.getExactDefinition(),
|
|
88
86
|
this.getMakeOptionalDefinition(),
|
|
89
87
|
this.getMakeMaybeDefinition(),
|
|
90
|
-
this.getMakeEmptyDefinition(),
|
|
91
|
-
this.getIncrementalDefinition(),
|
|
92
88
|
];
|
|
93
89
|
if (this.config.wrapFieldDefinitions) {
|
|
94
90
|
definitions.push(this.getFieldWrapperValue());
|
|
@@ -111,12 +107,6 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
|
|
|
111
107
|
return '';
|
|
112
108
|
return `${this.getExportPrefix()}${exports.MAKE_MAYBE_SIGNATURE}`;
|
|
113
109
|
}
|
|
114
|
-
getMakeEmptyDefinition() {
|
|
115
|
-
return `${this.getExportPrefix()}${exports.MAKE_EMPTY_SIGNATURE}`;
|
|
116
|
-
}
|
|
117
|
-
getIncrementalDefinition() {
|
|
118
|
-
return `${this.getExportPrefix()}${exports.MAKE_INCREMENTAL_SIGNATURE}`;
|
|
119
|
-
}
|
|
120
110
|
getMaybeValue() {
|
|
121
111
|
return `${this.getExportPrefix()}type Maybe<T> = ${this.config.maybeValue};`;
|
|
122
112
|
}
|
package/esm/visitor.js
CHANGED
|
@@ -5,8 +5,6 @@ import { TypeScriptOperationVariablesToObject } from './typescript-variables-to-
|
|
|
5
5
|
export const EXACT_SIGNATURE = `type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };`;
|
|
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
|
-
export const MAKE_EMPTY_SIGNATURE = `type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };`;
|
|
9
|
-
export const MAKE_INCREMENTAL_SIGNATURE = `type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };`;
|
|
10
8
|
export class TsVisitor extends BaseTypesVisitor {
|
|
11
9
|
constructor(schema, pluginConfig, additionalConfig = {}) {
|
|
12
10
|
super(schema, pluginConfig, {
|
|
@@ -83,8 +81,6 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
83
81
|
this.getExactDefinition(),
|
|
84
82
|
this.getMakeOptionalDefinition(),
|
|
85
83
|
this.getMakeMaybeDefinition(),
|
|
86
|
-
this.getMakeEmptyDefinition(),
|
|
87
|
-
this.getIncrementalDefinition(),
|
|
88
84
|
];
|
|
89
85
|
if (this.config.wrapFieldDefinitions) {
|
|
90
86
|
definitions.push(this.getFieldWrapperValue());
|
|
@@ -107,12 +103,6 @@ export class TsVisitor extends BaseTypesVisitor {
|
|
|
107
103
|
return '';
|
|
108
104
|
return `${this.getExportPrefix()}${MAKE_MAYBE_SIGNATURE}`;
|
|
109
105
|
}
|
|
110
|
-
getMakeEmptyDefinition() {
|
|
111
|
-
return `${this.getExportPrefix()}${MAKE_EMPTY_SIGNATURE}`;
|
|
112
|
-
}
|
|
113
|
-
getIncrementalDefinition() {
|
|
114
|
-
return `${this.getExportPrefix()}${MAKE_INCREMENTAL_SIGNATURE}`;
|
|
115
|
-
}
|
|
116
106
|
getMaybeValue() {
|
|
117
107
|
return `${this.getExportPrefix()}type Maybe<T> = ${this.config.maybeValue};`;
|
|
118
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript",
|
|
3
|
-
"version": "3.0.4-alpha-
|
|
3
|
+
"version": "3.0.4-alpha-20230421074125-e883aa652",
|
|
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": "^4.2.0",
|
|
10
10
|
"@graphql-codegen/schema-ast": "^3.0.1",
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "3.
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "3.1.1-alpha-20230421074125-e883aa652",
|
|
12
12
|
"auto-bind": "~4.0.0",
|
|
13
13
|
"tslib": "~2.5.0"
|
|
14
14
|
},
|
package/typings/visitor.d.cts
CHANGED
|
@@ -20,8 +20,6 @@ export interface TypeScriptPluginParsedConfig extends ParsedTypesConfig {
|
|
|
20
20
|
export declare const EXACT_SIGNATURE = "type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };";
|
|
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
|
-
export declare const MAKE_EMPTY_SIGNATURE = "type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };";
|
|
24
|
-
export declare const MAKE_INCREMENTAL_SIGNATURE = "type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };";
|
|
25
23
|
export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeScriptPluginConfig, TParsedConfig extends TypeScriptPluginParsedConfig = TypeScriptPluginParsedConfig> extends BaseTypesVisitor<TRawConfig, TParsedConfig> {
|
|
26
24
|
constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>);
|
|
27
25
|
protected _getTypeForNode(node: NamedTypeNode): string;
|
|
@@ -29,8 +27,6 @@ export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeS
|
|
|
29
27
|
getExactDefinition(): string;
|
|
30
28
|
getMakeOptionalDefinition(): string;
|
|
31
29
|
getMakeMaybeDefinition(): string;
|
|
32
|
-
getMakeEmptyDefinition(): string;
|
|
33
|
-
getIncrementalDefinition(): string;
|
|
34
30
|
getMaybeValue(): string;
|
|
35
31
|
getInputMaybeValue(): string;
|
|
36
32
|
protected clearOptional(str: string): string;
|
package/typings/visitor.d.ts
CHANGED
|
@@ -20,8 +20,6 @@ export interface TypeScriptPluginParsedConfig extends ParsedTypesConfig {
|
|
|
20
20
|
export declare const EXACT_SIGNATURE = "type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };";
|
|
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
|
-
export declare const MAKE_EMPTY_SIGNATURE = "type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };";
|
|
24
|
-
export declare const MAKE_INCREMENTAL_SIGNATURE = "type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };";
|
|
25
23
|
export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeScriptPluginConfig, TParsedConfig extends TypeScriptPluginParsedConfig = TypeScriptPluginParsedConfig> extends BaseTypesVisitor<TRawConfig, TParsedConfig> {
|
|
26
24
|
constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>);
|
|
27
25
|
protected _getTypeForNode(node: NamedTypeNode): string;
|
|
@@ -29,8 +27,6 @@ export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeS
|
|
|
29
27
|
getExactDefinition(): string;
|
|
30
28
|
getMakeOptionalDefinition(): string;
|
|
31
29
|
getMakeMaybeDefinition(): string;
|
|
32
|
-
getMakeEmptyDefinition(): string;
|
|
33
|
-
getIncrementalDefinition(): string;
|
|
34
30
|
getMaybeValue(): string;
|
|
35
31
|
getInputMaybeValue(): string;
|
|
36
32
|
protected clearOptional(str: string): string;
|