Skip to content

Commit 8f95c9e

Browse files
ikusakov2ikusakov
authored andcommitted
[typescript-operations] Remove inputmaybe and scalars (#10509)
* [typescript-operations] Remove generation of InputMaybe and Scalars for variables * Adding support for `config.scalars`, fixing intergation tests --------- Co-authored-by: Igor Kusakov <igor@kusakov.com>
1 parent 562d907 commit 8f95c9e

37 files changed

Lines changed: 312 additions & 245 deletions

.changeset/khaki-turtles-juggle.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@graphql-codegen/typescript-operations': major
3+
'@graphql-codegen/typescript': minor
4+
---
5+
6+
The `typescript-operations` plugin no longer generates InputMaybe and Scalars types; it now uses native Typescript types instead.

dev-test/githunt/typed-document-nodes.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export enum VoteType {
175175
}
176176

177177
export type OnCommentAddedSubscriptionVariables = Exact<{
178-
repoFullName: Scalars['String']['input'];
178+
repoFullName: string;
179179
}>;
180180

181181
export type OnCommentAddedSubscription = {
@@ -190,9 +190,9 @@ export type OnCommentAddedSubscription = {
190190
};
191191

192192
export type CommentQueryVariables = Exact<{
193-
repoFullName: Scalars['String']['input'];
194-
limit?: InputMaybe<Scalars['Int']['input']>;
195-
offset?: InputMaybe<Scalars['Int']['input']>;
193+
repoFullName: string;
194+
limit?: number | null;
195+
offset?: number | null;
196196
}>;
197197

198198
export type CommentQuery = {
@@ -258,8 +258,8 @@ export type FeedEntryFragment = {
258258

259259
export type FeedQueryVariables = Exact<{
260260
type: FeedType;
261-
offset?: InputMaybe<Scalars['Int']['input']>;
262-
limit?: InputMaybe<Scalars['Int']['input']>;
261+
offset?: number | null;
262+
limit?: number | null;
263263
}>;
264264

265265
export type FeedQuery = {
@@ -286,7 +286,7 @@ export type FeedQuery = {
286286
};
287287

288288
export type SubmitRepositoryMutationVariables = Exact<{
289-
repoFullName: Scalars['String']['input'];
289+
repoFullName: string;
290290
}>;
291291

292292
export type SubmitRepositoryMutation = {
@@ -307,8 +307,8 @@ export type RepoInfoFragment = {
307307
};
308308

309309
export type SubmitCommentMutationVariables = Exact<{
310-
repoFullName: Scalars['String']['input'];
311-
commentContent: Scalars['String']['input'];
310+
repoFullName: string;
311+
commentContent: string;
312312
}>;
313313

314314
export type SubmitCommentMutation = {
@@ -329,7 +329,7 @@ export type VoteButtonsFragment = {
329329
};
330330

331331
export type VoteMutationVariables = Exact<{
332-
repoFullName: Scalars['String']['input'];
332+
repoFullName: string;
333333
type: VoteType;
334334
}>;
335335

dev-test/githunt/types.avoidOptionals.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export enum VoteType {
173173
}
174174

175175
export type OnCommentAddedSubscriptionVariables = Exact<{
176-
repoFullName: Scalars['String']['input'];
176+
repoFullName: string;
177177
}>;
178178

179179
export type OnCommentAddedSubscription = {
@@ -188,9 +188,9 @@ export type OnCommentAddedSubscription = {
188188
};
189189

190190
export type CommentQueryVariables = Exact<{
191-
repoFullName: Scalars['String']['input'];
192-
limit: InputMaybe<Scalars['Int']['input']>;
193-
offset: InputMaybe<Scalars['Int']['input']>;
191+
repoFullName: string;
192+
limit: number | null;
193+
offset: number | null;
194194
}>;
195195

196196
export type CommentQuery = {
@@ -256,8 +256,8 @@ export type FeedEntryFragment = {
256256

257257
export type FeedQueryVariables = Exact<{
258258
type: FeedType;
259-
offset: InputMaybe<Scalars['Int']['input']>;
260-
limit: InputMaybe<Scalars['Int']['input']>;
259+
offset: number | null;
260+
limit: number | null;
261261
}>;
262262

263263
export type FeedQuery = {
@@ -284,7 +284,7 @@ export type FeedQuery = {
284284
};
285285

286286
export type SubmitRepositoryMutationVariables = Exact<{
287-
repoFullName: Scalars['String']['input'];
287+
repoFullName: string;
288288
}>;
289289

290290
export type SubmitRepositoryMutation = {
@@ -305,8 +305,8 @@ export type RepoInfoFragment = {
305305
};
306306

307307
export type SubmitCommentMutationVariables = Exact<{
308-
repoFullName: Scalars['String']['input'];
309-
commentContent: Scalars['String']['input'];
308+
repoFullName: string;
309+
commentContent: string;
310310
}>;
311311

312312
export type SubmitCommentMutation = {
@@ -327,7 +327,7 @@ export type VoteButtonsFragment = {
327327
};
328328

329329
export type VoteMutationVariables = Exact<{
330-
repoFullName: Scalars['String']['input'];
330+
repoFullName: string;
331331
type: VoteType;
332332
}>;
333333

dev-test/githunt/types.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export type Vote = {
168168
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';
169169

170170
export type OnCommentAddedSubscriptionVariables = Exact<{
171-
repoFullName: Scalars['String']['input'];
171+
repoFullName: string;
172172
}>;
173173

174174
export type OnCommentAddedSubscription = {
@@ -183,9 +183,9 @@ export type OnCommentAddedSubscription = {
183183
};
184184

185185
export type CommentQueryVariables = Exact<{
186-
repoFullName: Scalars['String']['input'];
187-
limit?: InputMaybe<Scalars['Int']['input']>;
188-
offset?: InputMaybe<Scalars['Int']['input']>;
186+
repoFullName: string;
187+
limit?: number | null;
188+
offset?: number | null;
189189
}>;
190190

191191
export type CommentQuery = {
@@ -251,8 +251,8 @@ export type FeedEntryFragment = {
251251

252252
export type FeedQueryVariables = Exact<{
253253
type: FeedType;
254-
offset?: InputMaybe<Scalars['Int']['input']>;
255-
limit?: InputMaybe<Scalars['Int']['input']>;
254+
offset?: number | null;
255+
limit?: number | null;
256256
}>;
257257

258258
export type FeedQuery = {
@@ -279,7 +279,7 @@ export type FeedQuery = {
279279
};
280280

281281
export type SubmitRepositoryMutationVariables = Exact<{
282-
repoFullName: Scalars['String']['input'];
282+
repoFullName: string;
283283
}>;
284284

285285
export type SubmitRepositoryMutation = {
@@ -300,8 +300,8 @@ export type RepoInfoFragment = {
300300
};
301301

302302
export type SubmitCommentMutationVariables = Exact<{
303-
repoFullName: Scalars['String']['input'];
304-
commentContent: Scalars['String']['input'];
303+
repoFullName: string;
304+
commentContent: string;
305305
}>;
306306

307307
export type SubmitCommentMutation = {
@@ -322,7 +322,7 @@ export type VoteButtonsFragment = {
322322
};
323323

324324
export type VoteMutationVariables = Exact<{
325-
repoFullName: Scalars['String']['input'];
325+
repoFullName: string;
326326
type: VoteType;
327327
}>;
328328

dev-test/githunt/types.enumsAsTypes.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export type Vote = {
168168
export type VoteType = 'CANCEL' | 'DOWN' | 'UP';
169169

170170
export type OnCommentAddedSubscriptionVariables = Exact<{
171-
repoFullName: Scalars['String']['input'];
171+
repoFullName: string;
172172
}>;
173173

174174
export type OnCommentAddedSubscription = {
@@ -183,9 +183,9 @@ export type OnCommentAddedSubscription = {
183183
};
184184

185185
export type CommentQueryVariables = Exact<{
186-
repoFullName: Scalars['String']['input'];
187-
limit?: InputMaybe<Scalars['Int']['input']>;
188-
offset?: InputMaybe<Scalars['Int']['input']>;
186+
repoFullName: string;
187+
limit?: number | null;
188+
offset?: number | null;
189189
}>;
190190

191191
export type CommentQuery = {
@@ -251,8 +251,8 @@ export type FeedEntryFragment = {
251251

252252
export type FeedQueryVariables = Exact<{
253253
type: FeedType;
254-
offset?: InputMaybe<Scalars['Int']['input']>;
255-
limit?: InputMaybe<Scalars['Int']['input']>;
254+
offset?: number | null;
255+
limit?: number | null;
256256
}>;
257257

258258
export type FeedQuery = {
@@ -279,7 +279,7 @@ export type FeedQuery = {
279279
};
280280

281281
export type SubmitRepositoryMutationVariables = Exact<{
282-
repoFullName: Scalars['String']['input'];
282+
repoFullName: string;
283283
}>;
284284

285285
export type SubmitRepositoryMutation = {
@@ -300,8 +300,8 @@ export type RepoInfoFragment = {
300300
};
301301

302302
export type SubmitCommentMutationVariables = Exact<{
303-
repoFullName: Scalars['String']['input'];
304-
commentContent: Scalars['String']['input'];
303+
repoFullName: string;
304+
commentContent: string;
305305
}>;
306306

307307
export type SubmitCommentMutation = {
@@ -322,7 +322,7 @@ export type VoteButtonsFragment = {
322322
};
323323

324324
export type VoteMutationVariables = Exact<{
325-
repoFullName: Scalars['String']['input'];
325+
repoFullName: string;
326326
type: VoteType;
327327
}>;
328328

dev-test/githunt/types.flatten.preResolveTypes.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export enum VoteType {
173173
}
174174

175175
export type OnCommentAddedSubscriptionVariables = Exact<{
176-
repoFullName: Scalars['String']['input'];
176+
repoFullName: string;
177177
}>;
178178

179179
export type OnCommentAddedSubscription = {
@@ -188,9 +188,9 @@ export type OnCommentAddedSubscription = {
188188
};
189189

190190
export type CommentQueryVariables = Exact<{
191-
repoFullName: Scalars['String']['input'];
192-
limit?: InputMaybe<Scalars['Int']['input']>;
193-
offset?: InputMaybe<Scalars['Int']['input']>;
191+
repoFullName: string;
192+
limit?: number | null;
193+
offset?: number | null;
194194
}>;
195195

196196
export type CommentQuery = {
@@ -229,8 +229,8 @@ export type CurrentUserForProfileQuery = {
229229

230230
export type FeedQueryVariables = Exact<{
231231
type: FeedType;
232-
offset?: InputMaybe<Scalars['Int']['input']>;
233-
limit?: InputMaybe<Scalars['Int']['input']>;
232+
offset?: number | null;
233+
limit?: number | null;
234234
}>;
235235

236236
export type FeedQuery = {
@@ -257,7 +257,7 @@ export type FeedQuery = {
257257
};
258258

259259
export type SubmitRepositoryMutationVariables = Exact<{
260-
repoFullName: Scalars['String']['input'];
260+
repoFullName: string;
261261
}>;
262262

263263
export type SubmitRepositoryMutation = {
@@ -266,8 +266,8 @@ export type SubmitRepositoryMutation = {
266266
};
267267

268268
export type SubmitCommentMutationVariables = Exact<{
269-
repoFullName: Scalars['String']['input'];
270-
commentContent: Scalars['String']['input'];
269+
repoFullName: string;
270+
commentContent: string;
271271
}>;
272272

273273
export type SubmitCommentMutation = {
@@ -282,7 +282,7 @@ export type SubmitCommentMutation = {
282282
};
283283

284284
export type VoteMutationVariables = Exact<{
285-
repoFullName: Scalars['String']['input'];
285+
repoFullName: string;
286286
type: VoteType;
287287
}>;
288288

dev-test/githunt/types.immutableTypes.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export enum VoteType {
173173
}
174174

175175
export type OnCommentAddedSubscriptionVariables = Exact<{
176-
repoFullName: Scalars['String']['input'];
176+
repoFullName: string;
177177
}>;
178178

179179
export type OnCommentAddedSubscription = {
@@ -192,9 +192,9 @@ export type OnCommentAddedSubscription = {
192192
};
193193

194194
export type CommentQueryVariables = Exact<{
195-
repoFullName: Scalars['String']['input'];
196-
limit?: InputMaybe<Scalars['Int']['input']>;
197-
offset?: InputMaybe<Scalars['Int']['input']>;
195+
repoFullName: string;
196+
limit?: number | null;
197+
offset?: number | null;
198198
}>;
199199

200200
export type CommentQuery = {
@@ -284,8 +284,8 @@ export type FeedEntryFragment = {
284284

285285
export type FeedQueryVariables = Exact<{
286286
type: FeedType;
287-
offset?: InputMaybe<Scalars['Int']['input']>;
288-
limit?: InputMaybe<Scalars['Int']['input']>;
287+
offset?: number | null;
288+
limit?: number | null;
289289
}>;
290290

291291
export type FeedQuery = {
@@ -316,7 +316,7 @@ export type FeedQuery = {
316316
};
317317

318318
export type SubmitRepositoryMutationVariables = Exact<{
319-
repoFullName: Scalars['String']['input'];
319+
repoFullName: string;
320320
}>;
321321

322322
export type SubmitRepositoryMutation = {
@@ -341,8 +341,8 @@ export type RepoInfoFragment = {
341341
};
342342

343343
export type SubmitCommentMutationVariables = Exact<{
344-
repoFullName: Scalars['String']['input'];
345-
commentContent: Scalars['String']['input'];
344+
repoFullName: string;
345+
commentContent: string;
346346
}>;
347347

348348
export type SubmitCommentMutation = {
@@ -367,7 +367,7 @@ export type VoteButtonsFragment = {
367367
};
368368

369369
export type VoteMutationVariables = Exact<{
370-
repoFullName: Scalars['String']['input'];
370+
repoFullName: string;
371371
type: VoteType;
372372
}>;
373373

0 commit comments

Comments
 (0)