|
| 1 | +import type { GraphQLResolveInfo } from 'graphql'; |
| 2 | +import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; |
| 3 | +export type Maybe<T> = T | null; |
| 4 | +export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }; |
| 5 | +export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> }; |
| 6 | +export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> }; |
| 7 | +/** All built-in and custom scalars, mapped to their actual values */ |
| 8 | +export type Scalars = { |
| 9 | + ID: string; |
| 10 | + String: string; |
| 11 | + Boolean: boolean; |
| 12 | + Int: number; |
| 13 | + Float: number; |
| 14 | +}; |
| 15 | + |
| 16 | +export type Query = { |
| 17 | + __typename?: 'Query'; |
| 18 | + hello: Scalars['String']; |
| 19 | +}; |
| 20 | + |
| 21 | +export type ResolverTypeWrapper<T> = Promise<T> | T; |
| 22 | + |
| 23 | +export type ResolverWithResolve<TResult, TParent, TContext, TArgs> = { |
| 24 | + resolve: ResolverFn<TResult, TParent, TContext, TArgs>; |
| 25 | +}; |
| 26 | +export type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> = |
| 27 | + | ResolverFn<TResult, TParent, TContext, TArgs> |
| 28 | + | ResolverWithResolve<TResult, TParent, TContext, TArgs>; |
| 29 | + |
| 30 | +export type ResolverFn<TResult, TParent, TContext, TArgs> = ( |
| 31 | + parent: TParent, |
| 32 | + args: TArgs, |
| 33 | + context: TContext, |
| 34 | + info: GraphQLResolveInfo |
| 35 | +) => Promise<TResult> | TResult; |
| 36 | + |
| 37 | +export type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = ( |
| 38 | + parent: TParent, |
| 39 | + args: TArgs, |
| 40 | + context: TContext, |
| 41 | + info: GraphQLResolveInfo |
| 42 | +) => AsyncIterator<TResult> | Promise<AsyncIterator<TResult>>; |
| 43 | + |
| 44 | +export type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = ( |
| 45 | + parent: TParent, |
| 46 | + args: TArgs, |
| 47 | + context: TContext, |
| 48 | + info: GraphQLResolveInfo |
| 49 | +) => TResult | Promise<TResult>; |
| 50 | + |
| 51 | +export interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> { |
| 52 | + subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>; |
| 53 | + resolve?: SubscriptionResolveFn<TResult, { [key in TKey]: TResult }, TContext, TArgs>; |
| 54 | +} |
| 55 | + |
| 56 | +export interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> { |
| 57 | + subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>; |
| 58 | + resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>; |
| 59 | +} |
| 60 | + |
| 61 | +export type SubscriptionObject<TResult, TKey extends string, TParent, TContext, TArgs> = |
| 62 | + | SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs> |
| 63 | + | SubscriptionResolverObject<TResult, TParent, TContext, TArgs>; |
| 64 | + |
| 65 | +export type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> = |
| 66 | + | ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>) |
| 67 | + | SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>; |
| 68 | + |
| 69 | +export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = ( |
| 70 | + parent: TParent, |
| 71 | + context: TContext, |
| 72 | + info: GraphQLResolveInfo |
| 73 | +) => Maybe<TTypes> | Promise<Maybe<TTypes>>; |
| 74 | + |
| 75 | +export type IsTypeOfResolverFn<T = {}, TContext = {}> = ( |
| 76 | + obj: T, |
| 77 | + context: TContext, |
| 78 | + info: GraphQLResolveInfo |
| 79 | +) => boolean | Promise<boolean>; |
| 80 | + |
| 81 | +export type NextResolverFn<T> = () => Promise<T>; |
| 82 | + |
| 83 | +export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = ( |
| 84 | + next: NextResolverFn<TResult>, |
| 85 | + parent: TParent, |
| 86 | + args: TArgs, |
| 87 | + context: TContext, |
| 88 | + info: GraphQLResolveInfo |
| 89 | +) => TResult | Promise<TResult>; |
| 90 | + |
| 91 | +/** Mapping between all available schema types and the resolvers types */ |
| 92 | +export type ResolversTypes = { |
| 93 | + Query: ResolverTypeWrapper<{}>; |
| 94 | + String: ResolverTypeWrapper<Scalars['String']>; |
| 95 | + Boolean: ResolverTypeWrapper<Scalars['Boolean']>; |
| 96 | +}; |
| 97 | + |
| 98 | +/** Mapping between all available schema types and the resolvers parents */ |
| 99 | +export type ResolversParentTypes = { |
| 100 | + Query: {}; |
| 101 | + String: Scalars['String']; |
| 102 | + Boolean: Scalars['Boolean']; |
| 103 | +}; |
| 104 | + |
| 105 | +export type QueryResolvers< |
| 106 | + ContextType = any, |
| 107 | + ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'] |
| 108 | +> = { |
| 109 | + hello?: Resolver<ResolversTypes['String'], ParentType, ContextType>; |
| 110 | +}; |
| 111 | + |
| 112 | +export type Resolvers<ContextType = any> = { |
| 113 | + Query?: QueryResolvers<ContextType>; |
| 114 | +}; |
| 115 | + |
| 116 | +export type HelloQueryVariables = Exact<{ [key: string]: never }>; |
| 117 | + |
| 118 | +export type HelloQuery = { __typename?: 'Query'; hello: string }; |
| 119 | + |
| 120 | +export const HelloDocument = { |
| 121 | + kind: 'Document', |
| 122 | + definitions: [ |
| 123 | + { |
| 124 | + kind: 'OperationDefinition', |
| 125 | + operation: 'query', |
| 126 | + name: { kind: 'Name', value: 'hello' }, |
| 127 | + selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'hello' } }] }, |
| 128 | + }, |
| 129 | + ], |
| 130 | +} as unknown as DocumentNode<HelloQuery, HelloQueryVariables>; |
0 commit comments