@graphql-codegen/typescript-document-nodes 2.3.4 → 2.3.5-alpha-20221018122157-1afce2555
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/package.json +2 -2
- package/typings/index.d.cts +97 -33
- package/typings/index.d.ts +97 -33
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-document-nodes",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5-alpha-20221018122157-1afce2555",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating TypeScript modules with embedded GraphQL document nodes",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@graphql-codegen/plugin-helpers": "^2.6.2",
|
|
10
|
-
"@graphql-codegen/visitor-plugin-common": "2.
|
|
10
|
+
"@graphql-codegen/visitor-plugin-common": "2.13.0-alpha-20221018122157-1afce2555",
|
|
11
11
|
"auto-bind": "~4.0.0",
|
|
12
12
|
"tslib": "~2.4.0"
|
|
13
13
|
},
|
package/typings/index.d.cts
CHANGED
|
@@ -19,31 +19,81 @@ export interface TypeScriptDocumentNodesRawPluginConfig extends RawClientSideBas
|
|
|
19
19
|
*
|
|
20
20
|
* @exampleMarkdown
|
|
21
21
|
* ## Override All Names
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* ```ts filename="codegen.ts"
|
|
23
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
24
|
+
*
|
|
25
|
+
* const config: CodegenConfig = {
|
|
26
|
+
* // ...
|
|
27
|
+
* generates: {
|
|
28
|
+
* 'path/to/file': {
|
|
29
|
+
* // plugins...
|
|
30
|
+
* config: {
|
|
31
|
+
* namingConvention: 'change-case-all#lowerCase',
|
|
32
|
+
* },
|
|
33
|
+
* },
|
|
34
|
+
* },
|
|
35
|
+
* };
|
|
36
|
+
* export default config;
|
|
25
37
|
* ```
|
|
26
38
|
*
|
|
27
39
|
* ## Upper-case enum values
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
40
|
+
* ```ts filename="codegen.ts"
|
|
41
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
42
|
+
*
|
|
43
|
+
* const config: CodegenConfig = {
|
|
44
|
+
* // ...
|
|
45
|
+
* generates: {
|
|
46
|
+
* 'path/to/file': {
|
|
47
|
+
* // plugins...
|
|
48
|
+
* config: {
|
|
49
|
+
* namingConvention: {
|
|
50
|
+
* typeNames: 'change-case-all#pascalCase',
|
|
51
|
+
* enumValues: 'change-case-all#upperCase',
|
|
52
|
+
* }
|
|
53
|
+
* },
|
|
54
|
+
* },
|
|
55
|
+
* },
|
|
56
|
+
* };
|
|
57
|
+
* export default config;
|
|
33
58
|
* ```
|
|
34
59
|
*
|
|
35
|
-
* ## Keep
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
*
|
|
60
|
+
* ## Keep names as is
|
|
61
|
+
* ```ts filename="codegen.ts"
|
|
62
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
63
|
+
*
|
|
64
|
+
* const config: CodegenConfig = {
|
|
65
|
+
* // ...
|
|
66
|
+
* generates: {
|
|
67
|
+
* 'path/to/file': {
|
|
68
|
+
* // plugins...
|
|
69
|
+
* config: {
|
|
70
|
+
* namingConvention: 'keep',
|
|
71
|
+
* },
|
|
72
|
+
* },
|
|
73
|
+
* },
|
|
74
|
+
* };
|
|
75
|
+
* export default config;
|
|
39
76
|
* ```
|
|
40
77
|
*
|
|
41
78
|
* ## Remove Underscores
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
79
|
+
* ```ts filename="codegen.ts"
|
|
80
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
81
|
+
*
|
|
82
|
+
* const config: CodegenConfig = {
|
|
83
|
+
* // ...
|
|
84
|
+
* generates: {
|
|
85
|
+
* 'path/to/file': {
|
|
86
|
+
* // plugins...
|
|
87
|
+
* config: {
|
|
88
|
+
* namingConvention: {
|
|
89
|
+
* typeNames: 'change-case-all#pascalCase',
|
|
90
|
+
* transformUnderscore: true
|
|
91
|
+
* }
|
|
92
|
+
* },
|
|
93
|
+
* },
|
|
94
|
+
* },
|
|
95
|
+
* };
|
|
96
|
+
* export default config;
|
|
47
97
|
* ```
|
|
48
98
|
*/
|
|
49
99
|
namingConvention?: NamingConvention;
|
|
@@ -52,14 +102,21 @@ export interface TypeScriptDocumentNodesRawPluginConfig extends RawClientSideBas
|
|
|
52
102
|
* @description Adds prefix to the name
|
|
53
103
|
*
|
|
54
104
|
* @exampleMarkdown
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
105
|
+
* ```ts filename="codegen.ts"
|
|
106
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
107
|
+
*
|
|
108
|
+
* const config: CodegenConfig = {
|
|
109
|
+
* // ...
|
|
110
|
+
* generates: {
|
|
111
|
+
* 'src/api/user-service/queries.ts': {
|
|
112
|
+
* plugins: ['typescript-document-nodes'],
|
|
113
|
+
* config: {
|
|
114
|
+
* namePrefix: 'gql',
|
|
115
|
+
* },
|
|
116
|
+
* },
|
|
117
|
+
* },
|
|
118
|
+
* };
|
|
119
|
+
* export default config;
|
|
63
120
|
* ```
|
|
64
121
|
*/
|
|
65
122
|
namePrefix?: string;
|
|
@@ -68,14 +125,21 @@ export interface TypeScriptDocumentNodesRawPluginConfig extends RawClientSideBas
|
|
|
68
125
|
* @description Adds suffix to the name
|
|
69
126
|
*
|
|
70
127
|
* @exampleMarkdown
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
128
|
+
* ```ts filename="codegen.ts"
|
|
129
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
130
|
+
*
|
|
131
|
+
* const config: CodegenConfig = {
|
|
132
|
+
* // ...
|
|
133
|
+
* generates: {
|
|
134
|
+
* 'src/api/user-service/queries.ts': {
|
|
135
|
+
* plugins: ['typescript-document-nodes'],
|
|
136
|
+
* config: {
|
|
137
|
+
* nameSuffix: 'Query'
|
|
138
|
+
* },
|
|
139
|
+
* },
|
|
140
|
+
* },
|
|
141
|
+
* };
|
|
142
|
+
* export default config;
|
|
79
143
|
* ```
|
|
80
144
|
*/
|
|
81
145
|
nameSuffix?: string;
|
package/typings/index.d.ts
CHANGED
|
@@ -19,31 +19,81 @@ export interface TypeScriptDocumentNodesRawPluginConfig extends RawClientSideBas
|
|
|
19
19
|
*
|
|
20
20
|
* @exampleMarkdown
|
|
21
21
|
* ## Override All Names
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* ```ts filename="codegen.ts"
|
|
23
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
24
|
+
*
|
|
25
|
+
* const config: CodegenConfig = {
|
|
26
|
+
* // ...
|
|
27
|
+
* generates: {
|
|
28
|
+
* 'path/to/file': {
|
|
29
|
+
* // plugins...
|
|
30
|
+
* config: {
|
|
31
|
+
* namingConvention: 'change-case-all#lowerCase',
|
|
32
|
+
* },
|
|
33
|
+
* },
|
|
34
|
+
* },
|
|
35
|
+
* };
|
|
36
|
+
* export default config;
|
|
25
37
|
* ```
|
|
26
38
|
*
|
|
27
39
|
* ## Upper-case enum values
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
40
|
+
* ```ts filename="codegen.ts"
|
|
41
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
42
|
+
*
|
|
43
|
+
* const config: CodegenConfig = {
|
|
44
|
+
* // ...
|
|
45
|
+
* generates: {
|
|
46
|
+
* 'path/to/file': {
|
|
47
|
+
* // plugins...
|
|
48
|
+
* config: {
|
|
49
|
+
* namingConvention: {
|
|
50
|
+
* typeNames: 'change-case-all#pascalCase',
|
|
51
|
+
* enumValues: 'change-case-all#upperCase',
|
|
52
|
+
* }
|
|
53
|
+
* },
|
|
54
|
+
* },
|
|
55
|
+
* },
|
|
56
|
+
* };
|
|
57
|
+
* export default config;
|
|
33
58
|
* ```
|
|
34
59
|
*
|
|
35
|
-
* ## Keep
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
*
|
|
60
|
+
* ## Keep names as is
|
|
61
|
+
* ```ts filename="codegen.ts"
|
|
62
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
63
|
+
*
|
|
64
|
+
* const config: CodegenConfig = {
|
|
65
|
+
* // ...
|
|
66
|
+
* generates: {
|
|
67
|
+
* 'path/to/file': {
|
|
68
|
+
* // plugins...
|
|
69
|
+
* config: {
|
|
70
|
+
* namingConvention: 'keep',
|
|
71
|
+
* },
|
|
72
|
+
* },
|
|
73
|
+
* },
|
|
74
|
+
* };
|
|
75
|
+
* export default config;
|
|
39
76
|
* ```
|
|
40
77
|
*
|
|
41
78
|
* ## Remove Underscores
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
79
|
+
* ```ts filename="codegen.ts"
|
|
80
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
81
|
+
*
|
|
82
|
+
* const config: CodegenConfig = {
|
|
83
|
+
* // ...
|
|
84
|
+
* generates: {
|
|
85
|
+
* 'path/to/file': {
|
|
86
|
+
* // plugins...
|
|
87
|
+
* config: {
|
|
88
|
+
* namingConvention: {
|
|
89
|
+
* typeNames: 'change-case-all#pascalCase',
|
|
90
|
+
* transformUnderscore: true
|
|
91
|
+
* }
|
|
92
|
+
* },
|
|
93
|
+
* },
|
|
94
|
+
* },
|
|
95
|
+
* };
|
|
96
|
+
* export default config;
|
|
47
97
|
* ```
|
|
48
98
|
*/
|
|
49
99
|
namingConvention?: NamingConvention;
|
|
@@ -52,14 +102,21 @@ export interface TypeScriptDocumentNodesRawPluginConfig extends RawClientSideBas
|
|
|
52
102
|
* @description Adds prefix to the name
|
|
53
103
|
*
|
|
54
104
|
* @exampleMarkdown
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
105
|
+
* ```ts filename="codegen.ts"
|
|
106
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
107
|
+
*
|
|
108
|
+
* const config: CodegenConfig = {
|
|
109
|
+
* // ...
|
|
110
|
+
* generates: {
|
|
111
|
+
* 'src/api/user-service/queries.ts': {
|
|
112
|
+
* plugins: ['typescript-document-nodes'],
|
|
113
|
+
* config: {
|
|
114
|
+
* namePrefix: 'gql',
|
|
115
|
+
* },
|
|
116
|
+
* },
|
|
117
|
+
* },
|
|
118
|
+
* };
|
|
119
|
+
* export default config;
|
|
63
120
|
* ```
|
|
64
121
|
*/
|
|
65
122
|
namePrefix?: string;
|
|
@@ -68,14 +125,21 @@ export interface TypeScriptDocumentNodesRawPluginConfig extends RawClientSideBas
|
|
|
68
125
|
* @description Adds suffix to the name
|
|
69
126
|
*
|
|
70
127
|
* @exampleMarkdown
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
128
|
+
* ```ts filename="codegen.ts"
|
|
129
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
130
|
+
*
|
|
131
|
+
* const config: CodegenConfig = {
|
|
132
|
+
* // ...
|
|
133
|
+
* generates: {
|
|
134
|
+
* 'src/api/user-service/queries.ts': {
|
|
135
|
+
* plugins: ['typescript-document-nodes'],
|
|
136
|
+
* config: {
|
|
137
|
+
* nameSuffix: 'Query'
|
|
138
|
+
* },
|
|
139
|
+
* },
|
|
140
|
+
* },
|
|
141
|
+
* };
|
|
142
|
+
* export default config;
|
|
79
143
|
* ```
|
|
80
144
|
*/
|
|
81
145
|
nameSuffix?: string;
|