Skip to content

Commit

Permalink
chore(example/react): update generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
vicary committed Feb 3, 2025
1 parent ccaf40e commit d59539e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 41 deletions.
31 changes: 19 additions & 12 deletions examples/react/api/ez.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export interface SubscriptionSubscriberObject<
TKey extends string,
TParent,
TContext,
TArgs
TArgs,
> {
subscribe: SubscriptionSubscribeFn<
{ [key in TKey]: TResult },
Expand All @@ -228,7 +228,7 @@ export type SubscriptionObject<
TKey extends string,
TParent,
TContext,
TArgs
TArgs,
> =
| SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>
| SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;
Expand All @@ -238,7 +238,7 @@ export type SubscriptionResolver<
TKey extends string,
TParent = {},
TContext = {},
TArgs = {}
TArgs = {},
> =
| ((
...args: any[]
Expand All @@ -263,7 +263,7 @@ export type DirectiveResolverFn<
TResult = {},
TParent = {},
TContext = {},
TArgs = {}
TArgs = {},
> = (
next: NextResolverFn<TResult>,
parent: TParent,
Expand Down Expand Up @@ -313,7 +313,7 @@ export type ResolversParentTypes = {

export type DogResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Dog'] = ResolversParentTypes['Dog']
ParentType extends ResolversParentTypes['Dog'] = ResolversParentTypes['Dog'],
> = {
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
Expand All @@ -323,7 +323,8 @@ export type DogResolvers<

export type HumanResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Human'] = ResolversParentTypes['Human']
ParentType extends
ResolversParentTypes['Human'] = ResolversParentTypes['Human'],
> = {
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
Expand All @@ -339,7 +340,8 @@ export type HumanResolvers<

export type QueryResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']
ParentType extends
ResolversParentTypes['Query'] = ResolversParentTypes['Query'],
> = {
expectedError?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
expectedNullableError?: Resolver<
Expand Down Expand Up @@ -378,7 +380,8 @@ export type QueryResolvers<

export type MutationResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']
ParentType extends
ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation'],
> = {
renameDog?: Resolver<
Maybe<ResolversTypes['Dog']>,
Expand Down Expand Up @@ -420,7 +423,8 @@ export type MutationResolvers<

export type SubscriptionResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']
ParentType extends
ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription'],
> = {
newNotification?: SubscriptionResolver<
ResolversTypes['String'],
Expand All @@ -432,7 +436,8 @@ export type SubscriptionResolvers<

export type HumansConnectionResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['HumansConnection'] = ResolversParentTypes['HumansConnection']
ParentType extends
ResolversParentTypes['HumansConnection'] = ResolversParentTypes['HumansConnection'],
> = {
pageInfo?: Resolver<ResolversTypes['PageInfo'], ParentType, ContextType>;
nodes?: Resolver<Array<ResolversTypes['Human']>, ParentType, ContextType>;
Expand All @@ -441,7 +446,8 @@ export type HumansConnectionResolvers<

export type PageInfoResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['PageInfo'] = ResolversParentTypes['PageInfo']
ParentType extends
ResolversParentTypes['PageInfo'] = ResolversParentTypes['PageInfo'],
> = {
hasPreviousPage?: Resolver<
ResolversTypes['Boolean'],
Expand All @@ -464,7 +470,8 @@ export type PageInfoResolvers<

export type SpeciesResolvers<
ContextType = EZContext,
ParentType extends ResolversParentTypes['Species'] = ResolversParentTypes['Species']
ParentType extends
ResolversParentTypes['Species'] = ResolversParentTypes['Species'],
> = {
__resolveType: TypeResolveFn<'Human' | 'Dog', ParentType, ContextType>;
};
Expand Down
2 changes: 1 addition & 1 deletion examples/react/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
70 changes: 42 additions & 28 deletions examples/react/src/graphql/schema.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* GQty AUTO-GENERATED CODE: PLEASE DO NOT MODIFY MANUALLY
*/

import { SchemaUnionsKey } from 'gqty';
import { SchemaUnionsKey, type ScalarsEnumsHash } from 'gqty';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
Expand All @@ -15,24 +15,33 @@ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
[SubKey in K]: Maybe<T[SubKey]>;
};
export type MakeEmpty<
T extends { [key: string]: unknown },
K extends keyof T,
> = { [_ in K]?: never };
export type Incremental<T> =
| T
| {
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
};
/** All built-in and custom scalars, mapped to their actual values */
export interface Scalars {
ID: string;
String: string;
Boolean: boolean;
Int: number;
Float: number;
ID: { input: string; output: string };
String: { input: string; output: string };
Boolean: { input: boolean; output: boolean };
Int: { input: number; output: number };
Float: { input: number; output: number };
/** The `Upload` scalar type represents a file upload. */
Upload: File;
Upload: { input: File; output: File };
}

/** ConnectionArgs description! */
export interface ConnectionArgs {
after?: InputMaybe<Scalars['String']>;
before?: InputMaybe<Scalars['String']>;
first?: InputMaybe<Scalars['Int']>;
after?: InputMaybe<Scalars['String']['input']>;
before?: InputMaybe<Scalars['String']['input']>;
first?: InputMaybe<Scalars['Int']['input']>;
/** @deprecated asd */
last?: InputMaybe<Scalars['Int']>;
last?: InputMaybe<Scalars['Int']['input']>;
}

/** Dog Type */
Expand All @@ -45,11 +54,11 @@ export enum DogType {

/** Input Type Example XD */
export interface inputTypeExample {
a: Scalars['String'];
other?: InputMaybe<Scalars['Int']>;
a: Scalars['String']['input'];
other?: InputMaybe<Scalars['Int']['input']>;
}

export const scalarsEnumsHash: import('gqty').ScalarsEnumsHash = {
export const scalarsEnumsHash: ScalarsEnumsHash = {
Boolean: true,
DogType: true,
ID: true,
Expand Down Expand Up @@ -148,7 +157,7 @@ export interface Human {
/**
* @defaultValue `"Hello World"`
*/
a?: Maybe<Scalars['String']>;
a?: Maybe<ScalarsEnums['String']>;
}) => Maybe<ScalarsEnums['Int']>;
id: ScalarsEnums['ID'];
/**
Expand Down Expand Up @@ -187,23 +196,28 @@ export interface Species {
*/
export interface Mutation {
__typename?: 'Mutation';
createHuman: (args: { id: Scalars['ID']; name: Scalars['String'] }) => Human;
createHuman: (args: {
id: ScalarsEnums['ID'];
name: ScalarsEnums['String'];
}) => Human;
other: (args: { arg: inputTypeExample }) => Maybe<ScalarsEnums['Int']>;
renameDog: (args: {
/**
* Dog Id
*/
id: Scalars['ID'];
name: Scalars['String'];
id: ScalarsEnums['ID'];
name: ScalarsEnums['String'];
}) => Maybe<Dog>;
renameHuman: (args: {
id: Scalars['ID'];
name: Scalars['String'];
id: ScalarsEnums['ID'];
name: ScalarsEnums['String'];
}) => Maybe<Human>;
sendNotification: (args: {
message: Scalars['String'];
message: ScalarsEnums['String'];
}) => ScalarsEnums['Boolean'];
uploadFile: (args: { file: Scalars['Upload'] }) => ScalarsEnums['String'];
uploadFile: (args: {
file: ScalarsEnums['Upload'];
}) => ScalarsEnums['String'];
}

/**
Expand Down Expand Up @@ -249,10 +263,10 @@ export interface GeneratedSchema {
subscription: Subscription;
}

export type MakeNullable<T> = {
[K in keyof T]: T[K] | undefined;
export type ScalarsEnums = {
[Key in keyof Scalars]: Scalars[Key] extends { output: unknown }
? Scalars[Key]['output']
: never;
} & {
DogType: DogType;
};

export interface ScalarsEnums extends MakeNullable<Scalars> {
DogType: DogType | undefined;
}

0 comments on commit d59539e

Please sign in to comment.