Skip to content

Commit 95ad968

Browse files
TS(definition): remove TS-specific TArgs (#2488)
Was added in DefinitelyTyped/DefinitelyTyped#32694 Motivation for removal #2481
1 parent fe878ee commit 95ad968

File tree

1 file changed

+14
-47
lines changed

1 file changed

+14
-47
lines changed

src/type/definition.d.ts

Lines changed: 14 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -375,23 +375,17 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
375375
* });
376376
*
377377
*/
378-
export class GraphQLObjectType<
379-
TSource = any,
380-
TContext = any,
381-
TArgs = { [key: string]: any }
382-
> {
378+
export class GraphQLObjectType<TSource = any, TContext = any> {
383379
name: string;
384380
description: Maybe<string>;
385381
isTypeOf: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
386382
extensions: Maybe<Readonly<Record<string, any>>>;
387383
astNode: Maybe<ObjectTypeDefinitionNode>;
388384
extensionASTNodes: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
389385

390-
constructor(
391-
config: Readonly<GraphQLObjectTypeConfig<TSource, TContext, TArgs>>,
392-
);
386+
constructor(config: Readonly<GraphQLObjectTypeConfig<TSource, TContext>>);
393387

394-
getFields(): GraphQLFieldMap<any, TContext, TArgs>;
388+
getFields(): GraphQLFieldMap<any, TContext>;
395389
getInterfaces(): Array<GraphQLInterfaceType>;
396390

397391
toConfig(): GraphQLObjectTypeConfig<any, any> & {
@@ -410,35 +404,23 @@ export function argsToArgsConfig(
410404
args: ReadonlyArray<GraphQLArgument>,
411405
): GraphQLFieldConfigArgumentMap;
412406

413-
// TS_SPECIFIC: TArgs
414-
export interface GraphQLObjectTypeConfig<
415-
TSource,
416-
TContext,
417-
TArgs = { [key: string]: any }
418-
> {
407+
export interface GraphQLObjectTypeConfig<TSource, TContext> {
419408
name: string;
420409
description?: Maybe<string>;
421410
interfaces?: Thunk<Maybe<Array<GraphQLInterfaceType>>>;
422-
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext, TArgs>>;
411+
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>;
423412
isTypeOf?: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
424413
extensions?: Maybe<Readonly<Record<string, any>>>;
425414
astNode?: Maybe<ObjectTypeDefinitionNode>;
426415
extensionASTNodes?: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
427416
}
428417

429-
// TS_SPECIFIC: TArgs
430-
export type GraphQLTypeResolver<
431-
TSource,
432-
TContext,
433-
TArgs = { [key: string]: any }
434-
> = (
418+
export type GraphQLTypeResolver<TSource, TContext> = (
435419
value: TSource,
436420
context: TContext,
437421
info: GraphQLResolveInfo,
438422
abstractType: GraphQLAbstractType,
439-
) => PromiseOrValue<
440-
Maybe<GraphQLObjectType<TSource, TContext, TArgs> | string>
441-
>;
423+
) => PromiseOrValue<Maybe<GraphQLObjectType<TSource, TContext> | string>>;
442424

443425
export type GraphQLIsTypeOfFn<TSource, TContext> = (
444426
source: TSource,
@@ -497,13 +479,8 @@ export interface GraphQLArgumentConfig {
497479
astNode?: Maybe<InputValueDefinitionNode>;
498480
}
499481

500-
// TS_SPECIFIC: TArgs
501-
export type GraphQLFieldConfigMap<
502-
TSource,
503-
TContext,
504-
TArgs = { [key: string]: any }
505-
> = {
506-
[key: string]: GraphQLFieldConfig<TSource, TContext, TArgs>;
482+
export type GraphQLFieldConfigMap<TSource, TContext> = {
483+
[key: string]: GraphQLFieldConfig<TSource, TContext>;
507484
};
508485

509486
export interface GraphQLField<
@@ -534,13 +511,8 @@ export interface GraphQLArgument {
534511

535512
export function isRequiredArgument(arg: GraphQLArgument): boolean;
536513

537-
// TS_SPECIFIC: TArgs
538-
export type GraphQLFieldMap<
539-
TSource,
540-
TContext,
541-
TArgs = { [key: string]: any }
542-
> = {
543-
[key: string]: GraphQLField<TSource, TContext, TArgs>;
514+
export type GraphQLFieldMap<TSource, TContext> = {
515+
[key: string]: GraphQLField<TSource, TContext>;
544516
};
545517

546518
/**
@@ -585,22 +557,17 @@ export class GraphQLInterfaceType {
585557
inspect(): string;
586558
}
587559

588-
// TS_SPECIFIC: TArgs
589-
export interface GraphQLInterfaceTypeConfig<
590-
TSource,
591-
TContext,
592-
TArgs = { [key: string]: any }
593-
> {
560+
export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
594561
name: string;
595562
description?: Maybe<string>;
596563
interfaces?: Thunk<Maybe<Array<GraphQLInterfaceType>>>;
597-
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext, TArgs>>;
564+
fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>;
598565
/**
599566
* Optionally provide a custom type resolver function. If one is not provided,
600567
* the default implementation will call `isTypeOf` on each implementing
601568
* Object type.
602569
*/
603-
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext, TArgs>>;
570+
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
604571
extensions?: Maybe<Readonly<Record<string, any>>>;
605572
astNode?: Maybe<InterfaceTypeDefinitionNode>;
606573
extensionASTNodes?: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;

0 commit comments

Comments
 (0)