@graphql-codegen/typescript 3.0.3-alpha-20230323121829-b809ff838 → 3.0.3-alpha-20230323123056-e823c9bbd

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 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_ALL_EMPTY_SIGNATURE = exports.MAKE_EMPTY_SIGNATURE = exports.MAKE_MAYBE_SIGNATURE = exports.MAKE_OPTIONAL_SIGNATURE = exports.EXACT_SIGNATURE = void 0;
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,9 +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_ALL_EMPTY_SIGNATURE = `type Empty<T> = { [P in keyof T]?: never };`;
14
- exports.MAKE_INCREMENTAL_SIGNATURE = `type Incremental<T> = T & { ' $defer': true };`;
15
12
  class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
16
13
  constructor(schema, pluginConfig, additionalConfig = {}) {
17
14
  super(schema, pluginConfig, {
@@ -88,9 +85,6 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
88
85
  this.getExactDefinition(),
89
86
  this.getMakeOptionalDefinition(),
90
87
  this.getMakeMaybeDefinition(),
91
- this.getMakeEmptyDefinition(),
92
- this.getMakeAllEmptyDefinition(),
93
- this.getIncrementalDefinition(),
94
88
  ];
95
89
  if (this.config.wrapFieldDefinitions) {
96
90
  definitions.push(this.getFieldWrapperValue());
@@ -113,15 +107,6 @@ class TsVisitor extends visitor_plugin_common_1.BaseTypesVisitor {
113
107
  return '';
114
108
  return `${this.getExportPrefix()}${exports.MAKE_MAYBE_SIGNATURE}`;
115
109
  }
116
- getMakeEmptyDefinition() {
117
- return `${this.getExportPrefix()}${exports.MAKE_EMPTY_SIGNATURE}`;
118
- }
119
- getMakeAllEmptyDefinition() {
120
- return `${this.getExportPrefix()}${exports.MAKE_ALL_EMPTY_SIGNATURE}`;
121
- }
122
- getIncrementalDefinition() {
123
- return `${this.getExportPrefix()}${exports.MAKE_INCREMENTAL_SIGNATURE}`;
124
- }
125
110
  getMaybeValue() {
126
111
  return `${this.getExportPrefix()}type Maybe<T> = ${this.config.maybeValue};`;
127
112
  }
package/esm/visitor.js CHANGED
@@ -5,9 +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_ALL_EMPTY_SIGNATURE = `type Empty<T> = { [P in keyof T]?: never };`;
10
- export const MAKE_INCREMENTAL_SIGNATURE = `type Incremental<T> = T & { ' $defer': true };`;
11
8
  export class TsVisitor extends BaseTypesVisitor {
12
9
  constructor(schema, pluginConfig, additionalConfig = {}) {
13
10
  super(schema, pluginConfig, {
@@ -84,9 +81,6 @@ export class TsVisitor extends BaseTypesVisitor {
84
81
  this.getExactDefinition(),
85
82
  this.getMakeOptionalDefinition(),
86
83
  this.getMakeMaybeDefinition(),
87
- this.getMakeEmptyDefinition(),
88
- this.getMakeAllEmptyDefinition(),
89
- this.getIncrementalDefinition(),
90
84
  ];
91
85
  if (this.config.wrapFieldDefinitions) {
92
86
  definitions.push(this.getFieldWrapperValue());
@@ -109,15 +103,6 @@ export class TsVisitor extends BaseTypesVisitor {
109
103
  return '';
110
104
  return `${this.getExportPrefix()}${MAKE_MAYBE_SIGNATURE}`;
111
105
  }
112
- getMakeEmptyDefinition() {
113
- return `${this.getExportPrefix()}${MAKE_EMPTY_SIGNATURE}`;
114
- }
115
- getMakeAllEmptyDefinition() {
116
- return `${this.getExportPrefix()}${MAKE_ALL_EMPTY_SIGNATURE}`;
117
- }
118
- getIncrementalDefinition() {
119
- return `${this.getExportPrefix()}${MAKE_INCREMENTAL_SIGNATURE}`;
120
- }
121
106
  getMaybeValue() {
122
107
  return `${this.getExportPrefix()}type Maybe<T> = ${this.config.maybeValue};`;
123
108
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript",
3
- "version": "3.0.3-alpha-20230323121829-b809ff838",
3
+ "version": "3.0.3-alpha-20230323123056-e823c9bbd",
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-20230323121829-b809ff838",
9
+ "@graphql-codegen/plugin-helpers": "4.2.0-alpha-20230323123056-e823c9bbd",
10
10
  "@graphql-codegen/schema-ast": "^3.0.1",
11
- "@graphql-codegen/visitor-plugin-common": "3.1.0-alpha-20230323121829-b809ff838",
11
+ "@graphql-codegen/visitor-plugin-common": "3.1.0-alpha-20230323123056-e823c9bbd",
12
12
  "auto-bind": "~4.0.0",
13
13
  "tslib": "~2.5.0"
14
14
  },
@@ -20,9 +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_ALL_EMPTY_SIGNATURE = "type Empty<T> = { [P in keyof T]?: never };";
25
- export declare const MAKE_INCREMENTAL_SIGNATURE = "type Incremental<T> = T & { ' $defer': true };";
26
23
  export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeScriptPluginConfig, TParsedConfig extends TypeScriptPluginParsedConfig = TypeScriptPluginParsedConfig> extends BaseTypesVisitor<TRawConfig, TParsedConfig> {
27
24
  constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>);
28
25
  protected _getTypeForNode(node: NamedTypeNode): string;
@@ -30,9 +27,6 @@ export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeS
30
27
  getExactDefinition(): string;
31
28
  getMakeOptionalDefinition(): string;
32
29
  getMakeMaybeDefinition(): string;
33
- getMakeEmptyDefinition(): string;
34
- getMakeAllEmptyDefinition(): string;
35
- getIncrementalDefinition(): string;
36
30
  getMaybeValue(): string;
37
31
  getInputMaybeValue(): string;
38
32
  protected clearOptional(str: string): string;
@@ -20,9 +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_ALL_EMPTY_SIGNATURE = "type Empty<T> = { [P in keyof T]?: never };";
25
- export declare const MAKE_INCREMENTAL_SIGNATURE = "type Incremental<T> = T & { ' $defer': true };";
26
23
  export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeScriptPluginConfig, TParsedConfig extends TypeScriptPluginParsedConfig = TypeScriptPluginParsedConfig> extends BaseTypesVisitor<TRawConfig, TParsedConfig> {
27
24
  constructor(schema: GraphQLSchema, pluginConfig: TRawConfig, additionalConfig?: Partial<TParsedConfig>);
28
25
  protected _getTypeForNode(node: NamedTypeNode): string;
@@ -30,9 +27,6 @@ export declare class TsVisitor<TRawConfig extends TypeScriptPluginConfig = TypeS
30
27
  getExactDefinition(): string;
31
28
  getMakeOptionalDefinition(): string;
32
29
  getMakeMaybeDefinition(): string;
33
- getMakeEmptyDefinition(): string;
34
- getMakeAllEmptyDefinition(): string;
35
- getIncrementalDefinition(): string;
36
30
  getMaybeValue(): string;
37
31
  getInputMaybeValue(): string;
38
32
  protected clearOptional(str: string): string;