From 95ad968268773986c338c8820664ca43fc95f7a2 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Fri, 13 Mar 2020 15:12:47 +0200 Subject: [PATCH] TS(definition): remove TS-specific TArgs (#2488) Was added in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32694 Motivation for removal #2481 --- src/type/definition.d.ts | 61 +++++++++------------------------------- 1 file changed, 14 insertions(+), 47 deletions(-) diff --git a/src/type/definition.d.ts b/src/type/definition.d.ts index 50d7343372..530a01a7e7 100644 --- a/src/type/definition.d.ts +++ b/src/type/definition.d.ts @@ -375,11 +375,7 @@ export interface GraphQLScalarTypeConfig { * }); * */ -export class GraphQLObjectType< - TSource = any, - TContext = any, - TArgs = { [key: string]: any } -> { +export class GraphQLObjectType { name: string; description: Maybe; isTypeOf: Maybe>; @@ -387,11 +383,9 @@ export class GraphQLObjectType< astNode: Maybe; extensionASTNodes: Maybe>; - constructor( - config: Readonly>, - ); + constructor(config: Readonly>); - getFields(): GraphQLFieldMap; + getFields(): GraphQLFieldMap; getInterfaces(): Array; toConfig(): GraphQLObjectTypeConfig & { @@ -410,35 +404,23 @@ export function argsToArgsConfig( args: ReadonlyArray, ): GraphQLFieldConfigArgumentMap; -// TS_SPECIFIC: TArgs -export interface GraphQLObjectTypeConfig< - TSource, - TContext, - TArgs = { [key: string]: any } -> { +export interface GraphQLObjectTypeConfig { name: string; description?: Maybe; interfaces?: Thunk>>; - fields: Thunk>; + fields: Thunk>; isTypeOf?: Maybe>; extensions?: Maybe>>; astNode?: Maybe; extensionASTNodes?: Maybe>; } -// TS_SPECIFIC: TArgs -export type GraphQLTypeResolver< - TSource, - TContext, - TArgs = { [key: string]: any } -> = ( +export type GraphQLTypeResolver = ( value: TSource, context: TContext, info: GraphQLResolveInfo, abstractType: GraphQLAbstractType, -) => PromiseOrValue< - Maybe | string> ->; +) => PromiseOrValue | string>>; export type GraphQLIsTypeOfFn = ( source: TSource, @@ -497,13 +479,8 @@ export interface GraphQLArgumentConfig { astNode?: Maybe; } -// TS_SPECIFIC: TArgs -export type GraphQLFieldConfigMap< - TSource, - TContext, - TArgs = { [key: string]: any } -> = { - [key: string]: GraphQLFieldConfig; +export type GraphQLFieldConfigMap = { + [key: string]: GraphQLFieldConfig; }; export interface GraphQLField< @@ -534,13 +511,8 @@ export interface GraphQLArgument { export function isRequiredArgument(arg: GraphQLArgument): boolean; -// TS_SPECIFIC: TArgs -export type GraphQLFieldMap< - TSource, - TContext, - TArgs = { [key: string]: any } -> = { - [key: string]: GraphQLField; +export type GraphQLFieldMap = { + [key: string]: GraphQLField; }; /** @@ -585,22 +557,17 @@ export class GraphQLInterfaceType { inspect(): string; } -// TS_SPECIFIC: TArgs -export interface GraphQLInterfaceTypeConfig< - TSource, - TContext, - TArgs = { [key: string]: any } -> { +export interface GraphQLInterfaceTypeConfig { name: string; description?: Maybe; interfaces?: Thunk>>; - fields: Thunk>; + fields: Thunk>; /** * 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>; + resolveType?: Maybe>; extensions?: Maybe>>; astNode?: Maybe; extensionASTNodes?: Maybe>;