Skip to content

Commit ec6e069

Browse files
committed
fix: types
1 parent 974efc6 commit ec6e069

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/decorators.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable:ban-types */
12
/*!
23
* @imqueue/type-graphql-dependency - Declarative GraphQL dependency loading
34
*
@@ -40,7 +41,7 @@ export interface DependentTypeRelations {
4041
filter: { [foreignField: string]: /*localField: */string };
4142
}
4243

43-
export type DependentType = (...args: any[]) => {} | ((...args: any[]) => {})[];
44+
export type DependentType = Function | Function[];
4445

4546
export interface DependsOptions<T> {
4647
require?: [() => DependentType, DependentTypeRelations[]][];
@@ -49,7 +50,7 @@ export interface DependsOptions<T> {
4950
}
5051

5152
export interface DependencyInterface<T> {
52-
(type: (...args: any[]) => {}): GraphQLDependency<T>;
53+
(type: Function): GraphQLDependency<T>;
5354
schema?: GraphQLSchema;
5455
}
5556

@@ -72,7 +73,7 @@ export interface DependencyInterface<T> {
7273
* @constructor
7374
*/
7475
export const Dependency: DependencyInterface<any> = (
75-
type: (...args: any[]) => {},
76+
type: Function,
7677
): GraphQLDependency<any> => {
7778
const { schema } = Dependency;
7879

@@ -81,6 +82,7 @@ export const Dependency: DependencyInterface<any> = (
8182
'nor any dependencies defied!');
8283
}
8384

85+
// noinspection TypeScriptRedundantGenericType
8486
const targetType = schema.getType(type.name) as GraphQLObjectType<any, any>;
8587

8688
if (!targetType || !targetType.getFields) {

0 commit comments

Comments
 (0)