@graphql-codegen/typescript-react-apollo 3.3.4 → 3.3.5-alpha-20221018123033-99bc320fe

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-react-apollo",
3
- "version": "3.3.4",
3
+ "version": "3.3.5-alpha-20221018123033-99bc320fe",
4
4
  "description": "GraphQL Code Generator plugin for generating a ready-to-use React Components/HOC/Hooks based on GraphQL operations",
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",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@graphql-codegen/plugin-helpers": "^2.6.2",
11
- "@graphql-codegen/visitor-plugin-common": "2.12.2",
11
+ "@graphql-codegen/visitor-plugin-common": "2.13.0-alpha-20221018123033-99bc320fe",
12
12
  "auto-bind": "~4.0.0",
13
13
  "change-case-all": "1.0.14",
14
14
  "tslib": "~2.4.0"
@@ -10,15 +10,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
10
10
  * @default false
11
11
  *
12
12
  * @exampleMarkdown
13
- * ```yaml
14
- * generates:
15
- * path/to/file.ts:
16
- * plugins:
17
- * - typescript
18
- * - typescript-operations
19
- * - typescript-react-apollo
20
- * config:
21
- * withComponent: true
13
+ * ```ts filename="codegen.ts"
14
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
15
+ *
16
+ * const config: CodegenConfig = {
17
+ * // ...
18
+ * generates: {
19
+ * 'path/to/file.ts': {
20
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
21
+ * config: {
22
+ * withComponent: true
23
+ * },
24
+ * },
25
+ * },
26
+ * };
27
+ * export default config;
22
28
  * ```
23
29
  */
24
30
  withComponent?: boolean;
@@ -27,15 +33,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
27
33
  * @default false
28
34
  *
29
35
  * @exampleMarkdown
30
- * ```yaml
31
- * generates:
32
- * path/to/file.ts:
33
- * plugins:
34
- * - typescript
35
- * - typescript-operations
36
- * - typescript-react-apollo
37
- * config:
38
- * withHOC: true
36
+ * ```ts filename="codegen.ts"
37
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
38
+ *
39
+ * const config: CodegenConfig = {
40
+ * // ...
41
+ * generates: {
42
+ * 'path/to/file.ts': {
43
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
44
+ * config: {
45
+ * withHOC: true
46
+ * },
47
+ * },
48
+ * },
49
+ * };
50
+ * export default config;
39
51
  * ```
40
52
  */
41
53
  withHOC?: boolean;
@@ -44,15 +56,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
44
56
  * @default true
45
57
  *
46
58
  * @exampleMarkdown
47
- * ```yaml
48
- * generates:
49
- * path/to/file.ts:
50
- * plugins:
51
- * - typescript
52
- * - typescript-operations
53
- * - typescript-react-apollo
54
- * config:
55
- * withHooks: true
59
+ * ```ts filename="codegen.ts"
60
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
61
+ *
62
+ * const config: CodegenConfig = {
63
+ * // ...
64
+ * generates: {
65
+ * 'path/to/file.ts': {
66
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
67
+ * config: {
68
+ * withHooks: true
69
+ * },
70
+ * },
71
+ * },
72
+ * };
73
+ * export default config;
56
74
  * ```
57
75
  */
58
76
  withHooks?: boolean;
@@ -61,15 +79,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
61
79
  * @default true
62
80
  *
63
81
  * @exampleMarkdown
64
- * ```yaml
65
- * generates:
66
- * path/to/file.ts:
67
- * plugins:
68
- * - typescript
69
- * - typescript-operations
70
- * - typescript-react-apollo
71
- * config:
72
- * withMutationFn: true
82
+ * ```ts filename="codegen.ts"
83
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
84
+ *
85
+ * const config: CodegenConfig = {
86
+ * // ...
87
+ * generates: {
88
+ * 'path/to/file.ts': {
89
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
90
+ * config: {
91
+ * withMutationFn: true
92
+ * },
93
+ * },
94
+ * },
95
+ * };
96
+ * export default config;
73
97
  * ```
74
98
  */
75
99
  withMutationFn?: boolean;
@@ -78,15 +102,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
78
102
  * @default false
79
103
  *
80
104
  * @exampleMarkdown
81
- * ```yaml
82
- * generates:
83
- * path/to/file.ts:
84
- * plugins:
85
- * - typescript
86
- * - typescript-operations
87
- * - typescript-react-apollo
88
- * config:
89
- * withRefetchFn: false
105
+ * ```ts filename="codegen.ts"
106
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
107
+ *
108
+ * const config: CodegenConfig = {
109
+ * // ...
110
+ * generates: {
111
+ * 'path/to/file.ts': {
112
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
113
+ * config: {
114
+ * withRefetchFn: false
115
+ * },
116
+ * },
117
+ * },
118
+ * };
119
+ * export default config;
90
120
  * ```
91
121
  */
92
122
  withRefetchFn?: boolean;
@@ -122,15 +152,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
122
152
  * @default 3
123
153
  *
124
154
  * @exampleMarkdown
125
- * ```yaml
126
- * generates:
127
- * path/to/file.ts:
128
- * plugins:
129
- * - typescript
130
- * - typescript-operations
131
- * - typescript-react-apollo
132
- * config:
133
- * reactApolloVersion: 2
155
+ * ```ts filename="codegen.ts"
156
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
157
+ *
158
+ * const config: CodegenConfig = {
159
+ * // ...
160
+ * generates: {
161
+ * 'path/to/file.ts': {
162
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
163
+ * config: {
164
+ * reactApolloVersion: 2
165
+ * },
166
+ * },
167
+ * },
168
+ * };
169
+ * export default config;
134
170
  * ```
135
171
  */
136
172
  reactApolloVersion?: 2 | 3;
@@ -139,15 +175,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
139
175
  * @default true
140
176
  *
141
177
  * @exampleMarkdown
142
- * ```yaml
143
- * generates:
144
- * path/to/file.ts:
145
- * plugins:
146
- * - typescript
147
- * - typescript-operations
148
- * - typescript-react-apollo
149
- * config:
150
- * withResultType: true
178
+ * ```ts filename="codegen.ts"
179
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
180
+ *
181
+ * const config: CodegenConfig = {
182
+ * // ...
183
+ * generates: {
184
+ * 'path/to/file.ts': {
185
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
186
+ * config: {
187
+ * withResultType: true
188
+ * },
189
+ * },
190
+ * },
191
+ * };
192
+ * export default config;
151
193
  * ```
152
194
  */
153
195
  withResultType?: boolean;
@@ -156,15 +198,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
156
198
  * @default true
157
199
  *
158
200
  * @exampleMarkdown
159
- * ```yaml
160
- * generates:
161
- * path/to/file.ts:
162
- * plugins:
163
- * - typescript
164
- * - typescript-operations
165
- * - typescript-react-apollo
166
- * config:
167
- * withMutationOptionsType: true
201
+ * ```ts filename="codegen.ts"
202
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
203
+ *
204
+ * const config: CodegenConfig = {
205
+ * // ...
206
+ * generates: {
207
+ * 'path/to/file.ts': {
208
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
209
+ * config: {
210
+ * withMutationOptionsType: true
211
+ * },
212
+ * },
213
+ * },
214
+ * };
215
+ * export default config;
168
216
  * ```
169
217
  */
170
218
  withMutationOptionsType?: boolean;
@@ -174,15 +222,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
174
222
  * @default true
175
223
  *
176
224
  * @exampleMarkdown
177
- * ```yaml
178
- * generates:
179
- * path/to/file.ts:
180
- * plugins:
181
- * - typescript
182
- * - typescript-operations
183
- * - typescript-react-apollo
184
- * config:
185
- * addDocBlocks: true
225
+ * ```ts filename="codegen.ts"
226
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
227
+ *
228
+ * const config: CodegenConfig = {
229
+ * // ...
230
+ * generates: {
231
+ * 'path/to/file.ts': {
232
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
233
+ * config: {
234
+ * addDocBlocks: true
235
+ * },
236
+ * },
237
+ * },
238
+ * };
239
+ * export default config;
186
240
  * ```
187
241
  */
188
242
  addDocBlocks?: boolean;
@@ -10,15 +10,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
10
10
  * @default false
11
11
  *
12
12
  * @exampleMarkdown
13
- * ```yaml
14
- * generates:
15
- * path/to/file.ts:
16
- * plugins:
17
- * - typescript
18
- * - typescript-operations
19
- * - typescript-react-apollo
20
- * config:
21
- * withComponent: true
13
+ * ```ts filename="codegen.ts"
14
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
15
+ *
16
+ * const config: CodegenConfig = {
17
+ * // ...
18
+ * generates: {
19
+ * 'path/to/file.ts': {
20
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
21
+ * config: {
22
+ * withComponent: true
23
+ * },
24
+ * },
25
+ * },
26
+ * };
27
+ * export default config;
22
28
  * ```
23
29
  */
24
30
  withComponent?: boolean;
@@ -27,15 +33,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
27
33
  * @default false
28
34
  *
29
35
  * @exampleMarkdown
30
- * ```yaml
31
- * generates:
32
- * path/to/file.ts:
33
- * plugins:
34
- * - typescript
35
- * - typescript-operations
36
- * - typescript-react-apollo
37
- * config:
38
- * withHOC: true
36
+ * ```ts filename="codegen.ts"
37
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
38
+ *
39
+ * const config: CodegenConfig = {
40
+ * // ...
41
+ * generates: {
42
+ * 'path/to/file.ts': {
43
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
44
+ * config: {
45
+ * withHOC: true
46
+ * },
47
+ * },
48
+ * },
49
+ * };
50
+ * export default config;
39
51
  * ```
40
52
  */
41
53
  withHOC?: boolean;
@@ -44,15 +56,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
44
56
  * @default true
45
57
  *
46
58
  * @exampleMarkdown
47
- * ```yaml
48
- * generates:
49
- * path/to/file.ts:
50
- * plugins:
51
- * - typescript
52
- * - typescript-operations
53
- * - typescript-react-apollo
54
- * config:
55
- * withHooks: true
59
+ * ```ts filename="codegen.ts"
60
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
61
+ *
62
+ * const config: CodegenConfig = {
63
+ * // ...
64
+ * generates: {
65
+ * 'path/to/file.ts': {
66
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
67
+ * config: {
68
+ * withHooks: true
69
+ * },
70
+ * },
71
+ * },
72
+ * };
73
+ * export default config;
56
74
  * ```
57
75
  */
58
76
  withHooks?: boolean;
@@ -61,15 +79,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
61
79
  * @default true
62
80
  *
63
81
  * @exampleMarkdown
64
- * ```yaml
65
- * generates:
66
- * path/to/file.ts:
67
- * plugins:
68
- * - typescript
69
- * - typescript-operations
70
- * - typescript-react-apollo
71
- * config:
72
- * withMutationFn: true
82
+ * ```ts filename="codegen.ts"
83
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
84
+ *
85
+ * const config: CodegenConfig = {
86
+ * // ...
87
+ * generates: {
88
+ * 'path/to/file.ts': {
89
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
90
+ * config: {
91
+ * withMutationFn: true
92
+ * },
93
+ * },
94
+ * },
95
+ * };
96
+ * export default config;
73
97
  * ```
74
98
  */
75
99
  withMutationFn?: boolean;
@@ -78,15 +102,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
78
102
  * @default false
79
103
  *
80
104
  * @exampleMarkdown
81
- * ```yaml
82
- * generates:
83
- * path/to/file.ts:
84
- * plugins:
85
- * - typescript
86
- * - typescript-operations
87
- * - typescript-react-apollo
88
- * config:
89
- * withRefetchFn: false
105
+ * ```ts filename="codegen.ts"
106
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
107
+ *
108
+ * const config: CodegenConfig = {
109
+ * // ...
110
+ * generates: {
111
+ * 'path/to/file.ts': {
112
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
113
+ * config: {
114
+ * withRefetchFn: false
115
+ * },
116
+ * },
117
+ * },
118
+ * };
119
+ * export default config;
90
120
  * ```
91
121
  */
92
122
  withRefetchFn?: boolean;
@@ -122,15 +152,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
122
152
  * @default 3
123
153
  *
124
154
  * @exampleMarkdown
125
- * ```yaml
126
- * generates:
127
- * path/to/file.ts:
128
- * plugins:
129
- * - typescript
130
- * - typescript-operations
131
- * - typescript-react-apollo
132
- * config:
133
- * reactApolloVersion: 2
155
+ * ```ts filename="codegen.ts"
156
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
157
+ *
158
+ * const config: CodegenConfig = {
159
+ * // ...
160
+ * generates: {
161
+ * 'path/to/file.ts': {
162
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
163
+ * config: {
164
+ * reactApolloVersion: 2
165
+ * },
166
+ * },
167
+ * },
168
+ * };
169
+ * export default config;
134
170
  * ```
135
171
  */
136
172
  reactApolloVersion?: 2 | 3;
@@ -139,15 +175,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
139
175
  * @default true
140
176
  *
141
177
  * @exampleMarkdown
142
- * ```yaml
143
- * generates:
144
- * path/to/file.ts:
145
- * plugins:
146
- * - typescript
147
- * - typescript-operations
148
- * - typescript-react-apollo
149
- * config:
150
- * withResultType: true
178
+ * ```ts filename="codegen.ts"
179
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
180
+ *
181
+ * const config: CodegenConfig = {
182
+ * // ...
183
+ * generates: {
184
+ * 'path/to/file.ts': {
185
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
186
+ * config: {
187
+ * withResultType: true
188
+ * },
189
+ * },
190
+ * },
191
+ * };
192
+ * export default config;
151
193
  * ```
152
194
  */
153
195
  withResultType?: boolean;
@@ -156,15 +198,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
156
198
  * @default true
157
199
  *
158
200
  * @exampleMarkdown
159
- * ```yaml
160
- * generates:
161
- * path/to/file.ts:
162
- * plugins:
163
- * - typescript
164
- * - typescript-operations
165
- * - typescript-react-apollo
166
- * config:
167
- * withMutationOptionsType: true
201
+ * ```ts filename="codegen.ts"
202
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
203
+ *
204
+ * const config: CodegenConfig = {
205
+ * // ...
206
+ * generates: {
207
+ * 'path/to/file.ts': {
208
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
209
+ * config: {
210
+ * withMutationOptionsType: true
211
+ * },
212
+ * },
213
+ * },
214
+ * };
215
+ * export default config;
168
216
  * ```
169
217
  */
170
218
  withMutationOptionsType?: boolean;
@@ -174,15 +222,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
174
222
  * @default true
175
223
  *
176
224
  * @exampleMarkdown
177
- * ```yaml
178
- * generates:
179
- * path/to/file.ts:
180
- * plugins:
181
- * - typescript
182
- * - typescript-operations
183
- * - typescript-react-apollo
184
- * config:
185
- * addDocBlocks: true
225
+ * ```ts filename="codegen.ts"
226
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
227
+ *
228
+ * const config: CodegenConfig = {
229
+ * // ...
230
+ * generates: {
231
+ * 'path/to/file.ts': {
232
+ * plugins: ['typescript', 'typescript-operations', 'typescript-operations'],
233
+ * config: {
234
+ * addDocBlocks: true
235
+ * },
236
+ * },
237
+ * },
238
+ * };
239
+ * export default config;
186
240
  * ```
187
241
  */
188
242
  addDocBlocks?: boolean;