1
+ /* tslint:disable:ban-types */
1
2
/*!
2
3
* @imqueue /type-graphql-dependency - Declarative GraphQL dependency loading
3
4
*
@@ -40,7 +41,7 @@ export interface DependentTypeRelations {
40
41
filter : { [ foreignField : string ] : /*localField: */ string } ;
41
42
}
42
43
43
- export type DependentType = ( ... args : any [ ] ) => { } | ( ( ... args : any [ ] ) => { } ) [ ] ;
44
+ export type DependentType = Function | Function [ ] ;
44
45
45
46
export interface DependsOptions < T > {
46
47
require ?: [ ( ) => DependentType , DependentTypeRelations [ ] ] [ ] ;
@@ -49,7 +50,7 @@ export interface DependsOptions<T> {
49
50
}
50
51
51
52
export interface DependencyInterface < T > {
52
- ( type : ( ... args : any [ ] ) => { } ) : GraphQLDependency < T > ;
53
+ ( type : Function ) : GraphQLDependency < T > ;
53
54
schema ?: GraphQLSchema ;
54
55
}
55
56
@@ -72,7 +73,7 @@ export interface DependencyInterface<T> {
72
73
* @constructor
73
74
*/
74
75
export const Dependency : DependencyInterface < any > = (
75
- type : ( ... args : any [ ] ) => { } ,
76
+ type : Function ,
76
77
) : GraphQLDependency < any > => {
77
78
const { schema } = Dependency ;
78
79
@@ -81,6 +82,7 @@ export const Dependency: DependencyInterface<any> = (
81
82
'nor any dependencies defied!' ) ;
82
83
}
83
84
85
+ // noinspection TypeScriptRedundantGenericType
84
86
const targetType = schema . getType ( type . name ) as GraphQLObjectType < any , any > ;
85
87
86
88
if ( ! targetType || ! targetType . getFields ) {
0 commit comments