Skip to content

Commit 67952cd

Browse files
ikusakov2ikusakov
andauthored
[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 <[email protected]>
1 parent 72e57ec commit 67952cd

File tree

37 files changed

+311
-242
lines changed

37 files changed

+311
-242
lines changed

.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
@@ -170,7 +170,7 @@ export enum VoteType {
170170
}
171171

172172
export type OnCommentAddedSubscriptionVariables = Exact<{
173-
repoFullName: Scalars['String']['input'];
173+
repoFullName: string;
174174
}>;
175175

176176
export type OnCommentAddedSubscription = {
@@ -185,9 +185,9 @@ export type OnCommentAddedSubscription = {
185185
};
186186

187187
export type CommentQueryVariables = Exact<{
188-
repoFullName: Scalars['String']['input'];
189-
limit?: InputMaybe<Scalars['Int']['input']>;
190-
offset?: InputMaybe<Scalars['Int']['input']>;
188+
repoFullName: string;
189+
limit?: number | null;
190+
offset?: number | null;
191191
}>;
192192

193193
export type CommentQuery = {
@@ -253,8 +253,8 @@ export type FeedEntryFragment = {
253253

254254
export type FeedQueryVariables = Exact<{
255255
type: FeedType;
256-
offset?: InputMaybe<Scalars['Int']['input']>;
257-
limit?: InputMaybe<Scalars['Int']['input']>;
256+
offset?: number | null;
257+
limit?: number | null;
258258
}>;
259259

260260
export type FeedQuery = {
@@ -281,7 +281,7 @@ export type FeedQuery = {
281281
};
282282

283283
export type SubmitRepositoryMutationVariables = Exact<{
284-
repoFullName: Scalars['String']['input'];
284+
repoFullName: string;
285285
}>;
286286

287287
export type SubmitRepositoryMutation = {
@@ -302,8 +302,8 @@ export type RepoInfoFragment = {
302302
};
303303

304304
export type SubmitCommentMutationVariables = Exact<{
305-
repoFullName: Scalars['String']['input'];
306-
commentContent: Scalars['String']['input'];
305+
repoFullName: string;
306+
commentContent: string;
307307
}>;
308308

309309
export type SubmitCommentMutation = {
@@ -324,7 +324,7 @@ export type VoteButtonsFragment = {
324324
};
325325

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

dev-test/githunt/types.avoidOptionals.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export enum VoteType {
169169
}
170170

171171
export type OnCommentAddedSubscriptionVariables = Exact<{
172-
repoFullName: Scalars['String']['input'];
172+
repoFullName: string;
173173
}>;
174174

175175
export type OnCommentAddedSubscription = {
@@ -184,9 +184,9 @@ export type OnCommentAddedSubscription = {
184184
};
185185

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

192192
export type CommentQuery = {
@@ -252,8 +252,8 @@ export type FeedEntryFragment = {
252252

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

259259
export type FeedQuery = {
@@ -280,7 +280,7 @@ export type FeedQuery = {
280280
};
281281

282282
export type SubmitRepositoryMutationVariables = Exact<{
283-
repoFullName: Scalars['String']['input'];
283+
repoFullName: string;
284284
}>;
285285

286286
export type SubmitRepositoryMutation = {
@@ -301,8 +301,8 @@ export type RepoInfoFragment = {
301301
};
302302

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

308308
export type SubmitCommentMutation = {
@@ -323,7 +323,7 @@ export type VoteButtonsFragment = {
323323
};
324324

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

dev-test/githunt/types.d.ts

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

166166
export type OnCommentAddedSubscriptionVariables = Exact<{
167-
repoFullName: Scalars['String']['input'];
167+
repoFullName: string;
168168
}>;
169169

170170
export type OnCommentAddedSubscription = {
@@ -179,9 +179,9 @@ export type OnCommentAddedSubscription = {
179179
};
180180

181181
export type CommentQueryVariables = Exact<{
182-
repoFullName: Scalars['String']['input'];
183-
limit?: InputMaybe<Scalars['Int']['input']>;
184-
offset?: InputMaybe<Scalars['Int']['input']>;
182+
repoFullName: string;
183+
limit?: number | null;
184+
offset?: number | null;
185185
}>;
186186

187187
export type CommentQuery = {
@@ -247,8 +247,8 @@ export type FeedEntryFragment = {
247247

248248
export type FeedQueryVariables = Exact<{
249249
type: FeedType;
250-
offset?: InputMaybe<Scalars['Int']['input']>;
251-
limit?: InputMaybe<Scalars['Int']['input']>;
250+
offset?: number | null;
251+
limit?: number | null;
252252
}>;
253253

254254
export type FeedQuery = {
@@ -275,7 +275,7 @@ export type FeedQuery = {
275275
};
276276

277277
export type SubmitRepositoryMutationVariables = Exact<{
278-
repoFullName: Scalars['String']['input'];
278+
repoFullName: string;
279279
}>;
280280

281281
export type SubmitRepositoryMutation = {
@@ -296,8 +296,8 @@ export type RepoInfoFragment = {
296296
};
297297

298298
export type SubmitCommentMutationVariables = Exact<{
299-
repoFullName: Scalars['String']['input'];
300-
commentContent: Scalars['String']['input'];
299+
repoFullName: string;
300+
commentContent: string;
301301
}>;
302302

303303
export type SubmitCommentMutation = {
@@ -318,7 +318,7 @@ export type VoteButtonsFragment = {
318318
};
319319

320320
export type VoteMutationVariables = Exact<{
321-
repoFullName: Scalars['String']['input'];
321+
repoFullName: string;
322322
type: VoteType;
323323
}>;
324324

dev-test/githunt/types.enumsAsTypes.ts

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

166166
export type OnCommentAddedSubscriptionVariables = Exact<{
167-
repoFullName: Scalars['String']['input'];
167+
repoFullName: string;
168168
}>;
169169

170170
export type OnCommentAddedSubscription = {
@@ -179,9 +179,9 @@ export type OnCommentAddedSubscription = {
179179
};
180180

181181
export type CommentQueryVariables = Exact<{
182-
repoFullName: Scalars['String']['input'];
183-
limit?: InputMaybe<Scalars['Int']['input']>;
184-
offset?: InputMaybe<Scalars['Int']['input']>;
182+
repoFullName: string;
183+
limit?: number | null;
184+
offset?: number | null;
185185
}>;
186186

187187
export type CommentQuery = {
@@ -247,8 +247,8 @@ export type FeedEntryFragment = {
247247

248248
export type FeedQueryVariables = Exact<{
249249
type: FeedType;
250-
offset?: InputMaybe<Scalars['Int']['input']>;
251-
limit?: InputMaybe<Scalars['Int']['input']>;
250+
offset?: number | null;
251+
limit?: number | null;
252252
}>;
253253

254254
export type FeedQuery = {
@@ -275,7 +275,7 @@ export type FeedQuery = {
275275
};
276276

277277
export type SubmitRepositoryMutationVariables = Exact<{
278-
repoFullName: Scalars['String']['input'];
278+
repoFullName: string;
279279
}>;
280280

281281
export type SubmitRepositoryMutation = {
@@ -296,8 +296,8 @@ export type RepoInfoFragment = {
296296
};
297297

298298
export type SubmitCommentMutationVariables = Exact<{
299-
repoFullName: Scalars['String']['input'];
300-
commentContent: Scalars['String']['input'];
299+
repoFullName: string;
300+
commentContent: string;
301301
}>;
302302

303303
export type SubmitCommentMutation = {
@@ -318,7 +318,7 @@ export type VoteButtonsFragment = {
318318
};
319319

320320
export type VoteMutationVariables = Exact<{
321-
repoFullName: Scalars['String']['input'];
321+
repoFullName: string;
322322
type: VoteType;
323323
}>;
324324

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export enum VoteType {
169169
}
170170

171171
export type OnCommentAddedSubscriptionVariables = Exact<{
172-
repoFullName: Scalars['String']['input'];
172+
repoFullName: string;
173173
}>;
174174

175175
export type OnCommentAddedSubscription = {
@@ -184,9 +184,9 @@ export type OnCommentAddedSubscription = {
184184
};
185185

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

192192
export type CommentQuery = {
@@ -225,8 +225,8 @@ export type CurrentUserForProfileQuery = {
225225

226226
export type FeedQueryVariables = Exact<{
227227
type: FeedType;
228-
offset?: InputMaybe<Scalars['Int']['input']>;
229-
limit?: InputMaybe<Scalars['Int']['input']>;
228+
offset?: number | null;
229+
limit?: number | null;
230230
}>;
231231

232232
export type FeedQuery = {
@@ -253,7 +253,7 @@ export type FeedQuery = {
253253
};
254254

255255
export type SubmitRepositoryMutationVariables = Exact<{
256-
repoFullName: Scalars['String']['input'];
256+
repoFullName: string;
257257
}>;
258258

259259
export type SubmitRepositoryMutation = {
@@ -262,8 +262,8 @@ export type SubmitRepositoryMutation = {
262262
};
263263

264264
export type SubmitCommentMutationVariables = Exact<{
265-
repoFullName: Scalars['String']['input'];
266-
commentContent: Scalars['String']['input'];
265+
repoFullName: string;
266+
commentContent: string;
267267
}>;
268268

269269
export type SubmitCommentMutation = {
@@ -278,7 +278,7 @@ export type SubmitCommentMutation = {
278278
};
279279

280280
export type VoteMutationVariables = Exact<{
281-
repoFullName: Scalars['String']['input'];
281+
repoFullName: string;
282282
type: VoteType;
283283
}>;
284284

dev-test/githunt/types.immutableTypes.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export enum VoteType {
169169
}
170170

171171
export type OnCommentAddedSubscriptionVariables = Exact<{
172-
repoFullName: Scalars['String']['input'];
172+
repoFullName: string;
173173
}>;
174174

175175
export type OnCommentAddedSubscription = {
@@ -184,9 +184,9 @@ export type OnCommentAddedSubscription = {
184184
};
185185

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

192192
export type CommentQuery = {
@@ -252,8 +252,8 @@ export type FeedEntryFragment = {
252252

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

259259
export type FeedQuery = {
@@ -280,7 +280,7 @@ export type FeedQuery = {
280280
};
281281

282282
export type SubmitRepositoryMutationVariables = Exact<{
283-
repoFullName: Scalars['String']['input'];
283+
repoFullName: string;
284284
}>;
285285

286286
export type SubmitRepositoryMutation = {
@@ -301,8 +301,8 @@ export type RepoInfoFragment = {
301301
};
302302

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

308308
export type SubmitCommentMutation = {
@@ -323,7 +323,7 @@ export type VoteButtonsFragment = {
323323
};
324324

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

0 commit comments

Comments
 (0)