import { GraphQLResolveInfo } from 'graphql';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
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 type Scalars = {
  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; }
};

export type ListTraceGroupsResponse = {
  __typename?: 'ListTraceGroupsResponse';
  traces: Array<Trace>;
};

export type Query = {
  __typename?: 'Query';
  listTraceGroups: ListTraceGroupsResponse;
};

export type Span = {
  __typename?: 'Span';
  attributes: Scalars['String']['output'];
  createdAt: Scalars['String']['output'];
  duration: Scalars['Float']['output'];
  endTimeUnixNano: Scalars['String']['output'];
  id: Scalars['ID']['output'];
  kind: Scalars['String']['output'];
  name: Scalars['String']['output'];
  parentSpanId?: Maybe<Scalars['String']['output']>;
  spanId: Scalars['String']['output'];
  startTimeUnixNano: Scalars['String']['output'];
  timestamp: Scalars['Float']['output'];
  traceId: Scalars['String']['output'];
  updatedAt: Scalars['String']['output'];
};

export type Trace = {
  __typename?: 'Trace';
  id: Scalars['String']['output'];
  spans: Array<Span>;
  traceId: Scalars['String']['output'];
};



export type ResolverTypeWrapper<T> = Promise<T> | T;


export type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
  resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
};
export type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> = ResolverFn<TResult, TParent, TContext, TArgs> | ResolverWithResolve<TResult, TParent, TContext, TArgs>;

export type ResolverFn<TResult, TParent, TContext, TArgs> = (
  parent: TParent,
  args: TArgs,
  context: TContext,
  info: GraphQLResolveInfo
) => Promise<TResult> | TResult;

export type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (
  parent: TParent,
  args: TArgs,
  context: TContext,
  info: GraphQLResolveInfo
) => AsyncIterable<TResult> | Promise<AsyncIterable<TResult>>;

export type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (
  parent: TParent,
  args: TArgs,
  context: TContext,
  info: GraphQLResolveInfo
) => TResult | Promise<TResult>;

export interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> {
  subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>;
  resolve?: SubscriptionResolveFn<TResult, { [key in TKey]: TResult }, TContext, TArgs>;
}

export interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> {
  subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>;
  resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>;
}

export type SubscriptionObject<TResult, TKey extends string, TParent, TContext, TArgs> =
  | SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>
  | SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;

export type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> =
  | ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>)
  | SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>;

export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = (
  parent: TParent,
  context: TContext,
  info: GraphQLResolveInfo
) => Maybe<TTypes> | Promise<Maybe<TTypes>>;

export type IsTypeOfResolverFn<T = {}, TContext = {}> = (obj: T, context: TContext, info: GraphQLResolveInfo) => boolean | Promise<boolean>;

export type NextResolverFn<T> = () => Promise<T>;

export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = (
  next: NextResolverFn<TResult>,
  parent: TParent,
  args: TArgs,
  context: TContext,
  info: GraphQLResolveInfo
) => TResult | Promise<TResult>;



/** Mapping between all available schema types and the resolvers types */
export type ResolversTypes = {
  Boolean: ResolverTypeWrapper<Scalars['Boolean']['output']>;
  Float: ResolverTypeWrapper<Scalars['Float']['output']>;
  ID: ResolverTypeWrapper<Scalars['ID']['output']>;
  ListTraceGroupsResponse: ResolverTypeWrapper<ListTraceGroupsResponse>;
  Query: ResolverTypeWrapper<{}>;
  Span: ResolverTypeWrapper<Span>;
  String: ResolverTypeWrapper<Scalars['String']['output']>;
  Trace: ResolverTypeWrapper<Trace>;
};

/** Mapping between all available schema types and the resolvers parents */
export type ResolversParentTypes = {
  Boolean: Scalars['Boolean']['output'];
  Float: Scalars['Float']['output'];
  ID: Scalars['ID']['output'];
  ListTraceGroupsResponse: ListTraceGroupsResponse;
  Query: {};
  Span: Span;
  String: Scalars['String']['output'];
  Trace: Trace;
};

export type TraceDirectiveArgs = { };

export type TraceDirectiveResolver<Result, Parent, ContextType = any, Args = TraceDirectiveArgs> = DirectiveResolverFn<Result, Parent, ContextType, Args>;

export type ListTraceGroupsResponseResolvers<ContextType = any, ParentType extends ResolversParentTypes['ListTraceGroupsResponse'] = ResolversParentTypes['ListTraceGroupsResponse']> = {
  traces?: Resolver<Array<ResolversTypes['Trace']>, ParentType, ContextType>;
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type QueryResolvers<ContextType = any, ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']> = {
  listTraceGroups?: Resolver<ResolversTypes['ListTraceGroupsResponse'], ParentType, ContextType>;
};

export type SpanResolvers<ContextType = any, ParentType extends ResolversParentTypes['Span'] = ResolversParentTypes['Span']> = {
  attributes?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  createdAt?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  duration?: Resolver<ResolversTypes['Float'], ParentType, ContextType>;
  endTimeUnixNano?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
  kind?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  parentSpanId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
  spanId?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  startTimeUnixNano?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  timestamp?: Resolver<ResolversTypes['Float'], ParentType, ContextType>;
  traceId?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  updatedAt?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type TraceResolvers<ContextType = any, ParentType extends ResolversParentTypes['Trace'] = ResolversParentTypes['Trace']> = {
  id?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  spans?: Resolver<Array<ResolversTypes['Span']>, ParentType, ContextType>;
  traceId?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type Resolvers<ContextType = any> = {
  ListTraceGroupsResponse?: ListTraceGroupsResponseResolvers<ContextType>;
  Query?: QueryResolvers<ContextType>;
  Span?: SpanResolvers<ContextType>;
  Trace?: TraceResolvers<ContextType>;
};

export type DirectiveResolvers<ContextType = any> = {
  trace?: TraceDirectiveResolver<any, any, ContextType>;
};
