Skip to content

Commit

Permalink
definitions: remove TS-specific TArgs
Browse files Browse the repository at this point in the history
Was added in DefinitelyTyped/DefinitelyTyped#32694
Motivation for removal graphql#2481
  • Loading branch information
IvanGoncharov committed Mar 12, 2020
1 parent fe878ee commit b6ea5b4
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions src/type/definition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
export class GraphQLObjectType<
TSource = any,
TContext = any,
TArgs = { [key: string]: any }
> {
name: string;
description: Maybe<string>;
Expand All @@ -388,10 +387,10 @@ export class GraphQLObjectType<
extensionASTNodes: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;

constructor(
config: Readonly<GraphQLObjectTypeConfig<TSource, TContext, TArgs>>,
config: Readonly<GraphQLObjectTypeConfig<TSource, TContext>>,
);

getFields(): GraphQLFieldMap<any, TContext, TArgs>;
getFields(): GraphQLFieldMap<any, TContext>;
getInterfaces(): Array<GraphQLInterfaceType>;

toConfig(): GraphQLObjectTypeConfig<any, any> & {
Expand All @@ -410,34 +409,30 @@ export function argsToArgsConfig(
args: ReadonlyArray<GraphQLArgument>,
): GraphQLFieldConfigArgumentMap;

// TS_SPECIFIC: TArgs
export interface GraphQLObjectTypeConfig<
TSource,
TContext,
TArgs = { [key: string]: any }
> {
name: string;
description?: Maybe<string>;
interfaces?: Thunk<Maybe<Array<GraphQLInterfaceType>>>;
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext, TArgs>>;
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>;
isTypeOf?: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
extensions?: Maybe<Readonly<Record<string, any>>>;
astNode?: Maybe<ObjectTypeDefinitionNode>;
extensionASTNodes?: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
}

// TS_SPECIFIC: TArgs
export type GraphQLTypeResolver<
TSource,
TContext,
TArgs = { [key: string]: any }
> = (
value: TSource,
context: TContext,
info: GraphQLResolveInfo,
abstractType: GraphQLAbstractType,
) => PromiseOrValue<
Maybe<GraphQLObjectType<TSource, TContext, TArgs> | string>
Maybe<GraphQLObjectType<TSource, TContext> | string>
>;

export type GraphQLIsTypeOfFn<TSource, TContext> = (
Expand Down Expand Up @@ -493,17 +488,16 @@ export interface GraphQLArgumentConfig {
description?: Maybe<string>;
type: GraphQLInputType;
defaultValue?: any;
deprecationReason?: Maybe<string>;
extensions?: Maybe<Readonly<Record<string, any>>>;
astNode?: Maybe<InputValueDefinitionNode>;
}

// TS_SPECIFIC: TArgs
export type GraphQLFieldConfigMap<
TSource,
TContext,
TArgs = { [key: string]: any }
> = {
[key: string]: GraphQLFieldConfig<TSource, TContext, TArgs>;
[key: string]: GraphQLFieldConfig<TSource, TContext>;
};

export interface GraphQLField<
Expand All @@ -528,19 +522,19 @@ export interface GraphQLArgument {
description: Maybe<string>;
type: GraphQLInputType;
defaultValue: any;
isDeprecated: boolean;
deprecationReason: Maybe<string>;
extensions: Maybe<Readonly<Record<string, any>>>;
astNode: Maybe<InputValueDefinitionNode>;
}

export function isRequiredArgument(arg: GraphQLArgument): boolean;

// TS_SPECIFIC: TArgs
export type GraphQLFieldMap<
TSource,
TContext,
TArgs = { [key: string]: any }
> = {
[key: string]: GraphQLField<TSource, TContext, TArgs>;
[key: string]: GraphQLField<TSource, TContext>;
};

/**
Expand Down Expand Up @@ -585,22 +579,20 @@ export class GraphQLInterfaceType {
inspect(): string;
}

// TS_SPECIFIC: TArgs
export interface GraphQLInterfaceTypeConfig<
TSource,
TContext,
TArgs = { [key: string]: any }
> {
name: string;
description?: Maybe<string>;
interfaces?: Thunk<Maybe<Array<GraphQLInterfaceType>>>;
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext, TArgs>>;
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>;
/**
* Optionally provide a custom type resolver function. If one is not provided,
* the default implementation will call `isTypeOf` on each implementing
* Object type.
*/
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext, TArgs>>;
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
extensions?: Maybe<Readonly<Record<string, any>>>;
astNode?: Maybe<InterfaceTypeDefinitionNode>;
extensionASTNodes?: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
Expand Down Expand Up @@ -799,6 +791,7 @@ export interface GraphQLInputFieldConfig {
description?: Maybe<string>;
type: GraphQLInputType;
defaultValue?: any;
deprecationReason?: Maybe<string>;
extensions?: Maybe<Readonly<Record<string, any>>>;
astNode?: Maybe<InputValueDefinitionNode>;
}
Expand All @@ -812,6 +805,8 @@ export interface GraphQLInputField {
description?: Maybe<string>;
type: GraphQLInputType;
defaultValue?: any;
isDeprecated: boolean;
deprecationReason: Maybe<string>;
extensions: Maybe<Readonly<Record<string, any>>>;
astNode?: Maybe<InputValueDefinitionNode>;
}
Expand Down

0 comments on commit b6ea5b4

Please sign in to comment.