Skip to content

Commit d59539e

Browse files
committed
chore(example/react): update generated files
1 parent ccaf40e commit d59539e

File tree

3 files changed

+62
-41
lines changed

3 files changed

+62
-41
lines changed

examples/react/api/ez.generated.ts

+19-12
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export interface SubscriptionSubscriberObject<
202202
TKey extends string,
203203
TParent,
204204
TContext,
205-
TArgs
205+
TArgs,
206206
> {
207207
subscribe: SubscriptionSubscribeFn<
208208
{ [key in TKey]: TResult },
@@ -228,7 +228,7 @@ export type SubscriptionObject<
228228
TKey extends string,
229229
TParent,
230230
TContext,
231-
TArgs
231+
TArgs,
232232
> =
233233
| SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>
234234
| SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;
@@ -238,7 +238,7 @@ export type SubscriptionResolver<
238238
TKey extends string,
239239
TParent = {},
240240
TContext = {},
241-
TArgs = {}
241+
TArgs = {},
242242
> =
243243
| ((
244244
...args: any[]
@@ -263,7 +263,7 @@ export type DirectiveResolverFn<
263263
TResult = {},
264264
TParent = {},
265265
TContext = {},
266-
TArgs = {}
266+
TArgs = {},
267267
> = (
268268
next: NextResolverFn<TResult>,
269269
parent: TParent,
@@ -313,7 +313,7 @@ export type ResolversParentTypes = {
313313

314314
export type DogResolvers<
315315
ContextType = EZContext,
316-
ParentType extends ResolversParentTypes['Dog'] = ResolversParentTypes['Dog']
316+
ParentType extends ResolversParentTypes['Dog'] = ResolversParentTypes['Dog'],
317317
> = {
318318
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
319319
name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
@@ -323,7 +323,8 @@ export type DogResolvers<
323323

324324
export type HumanResolvers<
325325
ContextType = EZContext,
326-
ParentType extends ResolversParentTypes['Human'] = ResolversParentTypes['Human']
326+
ParentType extends
327+
ResolversParentTypes['Human'] = ResolversParentTypes['Human'],
327328
> = {
328329
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
329330
name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
@@ -339,7 +340,8 @@ export type HumanResolvers<
339340

340341
export type QueryResolvers<
341342
ContextType = EZContext,
342-
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
343+
ParentType extends
344+
ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
343345
> = {
344346
expectedError?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
345347
expectedNullableError?: Resolver<
@@ -378,7 +380,8 @@ export type QueryResolvers<
378380

379381
export type MutationResolvers<
380382
ContextType = EZContext,
381-
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']
383+
ParentType extends
384+
ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation'],
382385
> = {
383386
renameDog?: Resolver<
384387
Maybe<ResolversTypes['Dog']>,
@@ -420,7 +423,8 @@ export type MutationResolvers<
420423

421424
export type SubscriptionResolvers<
422425
ContextType = EZContext,
423-
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']
426+
ParentType extends
427+
ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription'],
424428
> = {
425429
newNotification?: SubscriptionResolver<
426430
ResolversTypes['String'],
@@ -432,7 +436,8 @@ export type SubscriptionResolvers<
432436

433437
export type HumansConnectionResolvers<
434438
ContextType = EZContext,
435-
ParentType extends ResolversParentTypes['HumansConnection'] = ResolversParentTypes['HumansConnection']
439+
ParentType extends
440+
ResolversParentTypes['HumansConnection'] = ResolversParentTypes['HumansConnection'],
436441
> = {
437442
pageInfo?: Resolver<ResolversTypes['PageInfo'], ParentType, ContextType>;
438443
nodes?: Resolver<Array<ResolversTypes['Human']>, ParentType, ContextType>;
@@ -441,7 +446,8 @@ export type HumansConnectionResolvers<
441446

442447
export type PageInfoResolvers<
443448
ContextType = EZContext,
444-
ParentType extends ResolversParentTypes['PageInfo'] = ResolversParentTypes['PageInfo']
449+
ParentType extends
450+
ResolversParentTypes['PageInfo'] = ResolversParentTypes['PageInfo'],
445451
> = {
446452
hasPreviousPage?: Resolver<
447453
ResolversTypes['Boolean'],
@@ -464,7 +470,8 @@ export type PageInfoResolvers<
464470

465471
export type SpeciesResolvers<
466472
ContextType = EZContext,
467-
ParentType extends ResolversParentTypes['Species'] = ResolversParentTypes['Species']
473+
ParentType extends
474+
ResolversParentTypes['Species'] = ResolversParentTypes['Species'],
468475
> = {
469476
__resolveType: TypeResolveFn<'Human' | 'Dog', ParentType, ContextType>;
470477
};

examples/react/next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

examples/react/src/graphql/schema.generated.ts

+42-28
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* GQty AUTO-GENERATED CODE: PLEASE DO NOT MODIFY MANUALLY
33
*/
44

5-
import { SchemaUnionsKey } from 'gqty';
5+
import { SchemaUnionsKey, type ScalarsEnumsHash } from 'gqty';
66

77
export type Maybe<T> = T | null;
88
export type InputMaybe<T> = Maybe<T>;
@@ -15,24 +15,33 @@ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
1515
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
1616
[SubKey in K]: Maybe<T[SubKey]>;
1717
};
18+
export type MakeEmpty<
19+
T extends { [key: string]: unknown },
20+
K extends keyof T,
21+
> = { [_ in K]?: never };
22+
export type Incremental<T> =
23+
| T
24+
| {
25+
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
26+
};
1827
/** All built-in and custom scalars, mapped to their actual values */
1928
export interface Scalars {
20-
ID: string;
21-
String: string;
22-
Boolean: boolean;
23-
Int: number;
24-
Float: number;
29+
ID: { input: string; output: string };
30+
String: { input: string; output: string };
31+
Boolean: { input: boolean; output: boolean };
32+
Int: { input: number; output: number };
33+
Float: { input: number; output: number };
2534
/** The `Upload` scalar type represents a file upload. */
26-
Upload: File;
35+
Upload: { input: File; output: File };
2736
}
2837

2938
/** ConnectionArgs description! */
3039
export interface ConnectionArgs {
31-
after?: InputMaybe<Scalars['String']>;
32-
before?: InputMaybe<Scalars['String']>;
33-
first?: InputMaybe<Scalars['Int']>;
40+
after?: InputMaybe<Scalars['String']['input']>;
41+
before?: InputMaybe<Scalars['String']['input']>;
42+
first?: InputMaybe<Scalars['Int']['input']>;
3443
/** @deprecated asd */
35-
last?: InputMaybe<Scalars['Int']>;
44+
last?: InputMaybe<Scalars['Int']['input']>;
3645
}
3746

3847
/** Dog Type */
@@ -45,11 +54,11 @@ export enum DogType {
4554

4655
/** Input Type Example XD */
4756
export interface inputTypeExample {
48-
a: Scalars['String'];
49-
other?: InputMaybe<Scalars['Int']>;
57+
a: Scalars['String']['input'];
58+
other?: InputMaybe<Scalars['Int']['input']>;
5059
}
5160

52-
export const scalarsEnumsHash: import('gqty').ScalarsEnumsHash = {
61+
export const scalarsEnumsHash: ScalarsEnumsHash = {
5362
Boolean: true,
5463
DogType: true,
5564
ID: true,
@@ -148,7 +157,7 @@ export interface Human {
148157
/**
149158
* @defaultValue `"Hello World"`
150159
*/
151-
a?: Maybe<Scalars['String']>;
160+
a?: Maybe<ScalarsEnums['String']>;
152161
}) => Maybe<ScalarsEnums['Int']>;
153162
id: ScalarsEnums['ID'];
154163
/**
@@ -187,23 +196,28 @@ export interface Species {
187196
*/
188197
export interface Mutation {
189198
__typename?: 'Mutation';
190-
createHuman: (args: { id: Scalars['ID']; name: Scalars['String'] }) => Human;
199+
createHuman: (args: {
200+
id: ScalarsEnums['ID'];
201+
name: ScalarsEnums['String'];
202+
}) => Human;
191203
other: (args: { arg: inputTypeExample }) => Maybe<ScalarsEnums['Int']>;
192204
renameDog: (args: {
193205
/**
194206
* Dog Id
195207
*/
196-
id: Scalars['ID'];
197-
name: Scalars['String'];
208+
id: ScalarsEnums['ID'];
209+
name: ScalarsEnums['String'];
198210
}) => Maybe<Dog>;
199211
renameHuman: (args: {
200-
id: Scalars['ID'];
201-
name: Scalars['String'];
212+
id: ScalarsEnums['ID'];
213+
name: ScalarsEnums['String'];
202214
}) => Maybe<Human>;
203215
sendNotification: (args: {
204-
message: Scalars['String'];
216+
message: ScalarsEnums['String'];
205217
}) => ScalarsEnums['Boolean'];
206-
uploadFile: (args: { file: Scalars['Upload'] }) => ScalarsEnums['String'];
218+
uploadFile: (args: {
219+
file: ScalarsEnums['Upload'];
220+
}) => ScalarsEnums['String'];
207221
}
208222

209223
/**
@@ -249,10 +263,10 @@ export interface GeneratedSchema {
249263
subscription: Subscription;
250264
}
251265

252-
export type MakeNullable<T> = {
253-
[K in keyof T]: T[K] | undefined;
266+
export type ScalarsEnums = {
267+
[Key in keyof Scalars]: Scalars[Key] extends { output: unknown }
268+
? Scalars[Key]['output']
269+
: never;
270+
} & {
271+
DogType: DogType;
254272
};
255-
256-
export interface ScalarsEnums extends MakeNullable<Scalars> {
257-
DogType: DogType | undefined;
258-
}

0 commit comments

Comments
 (0)