Skip to content

Commit cde9d0e

Browse files
Replace 'any' with 'mixed' in return types of various resolvers (#345)
1 parent 8c0535e commit cde9d0e

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

src/mutation/mutation.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type MutationFn = (
1212
object: any,
1313
ctx: any,
1414
info: GraphQLResolveInfo,
15-
) => Promise<any> | any;
15+
) => unknown;
1616

1717
// TS_SPECIFIC: This type is only exported by TypeScript
1818
/**

src/mutation/mutation.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ import type {
1313
Thunk,
1414
} from 'graphql';
1515

16-
type MutationFn = (
17-
object: any,
18-
ctx: any,
19-
info: GraphQLResolveInfo,
20-
) => Promise<any> | any;
16+
import isPromise from 'graphql/jsutils/isPromise';
17+
18+
type MutationFn = (object: any, ctx: any, info: GraphQLResolveInfo) => mixed;
2119

2220
function resolveMaybeThunk<T>(thingOrThunk: Thunk<T>): T {
2321
return typeof thingOrThunk === 'function'
@@ -100,7 +98,3 @@ export function mutationWithClientMutationId(
10098
},
10199
};
102100
}
103-
104-
function isPromise(value: any): boolean {
105-
return typeof value?.then === 'function';
106-
}

src/node/plural.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface PluralIdentifyingRootFieldConfig {
1414
input: any,
1515
context: any,
1616
info: GraphQLResolveInfo,
17-
) => any;
17+
) => unknown;
1818
description?: string;
1919
}
2020

src/node/plural.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type PluralIdentifyingRootFieldConfig = {|
1515
input: any,
1616
context: any,
1717
info: GraphQLResolveInfo,
18-
) => ?any,
18+
) => mixed,
1919
description?: string,
2020
|};
2121

0 commit comments

Comments
 (0)