Skip to content

Commit

Permalink
Replace 'any' with 'mixed' in return types of various resolvers (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Jun 25, 2021
1 parent 8c0535e commit cde9d0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/mutation/mutation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type MutationFn = (
object: any,
ctx: any,
info: GraphQLResolveInfo,
) => Promise<any> | any;
) => unknown;

// TS_SPECIFIC: This type is only exported by TypeScript
/**
Expand Down
12 changes: 3 additions & 9 deletions src/mutation/mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import type {
Thunk,
} from 'graphql';

type MutationFn = (
object: any,
ctx: any,
info: GraphQLResolveInfo,
) => Promise<any> | any;
import isPromise from 'graphql/jsutils/isPromise';

type MutationFn = (object: any, ctx: any, info: GraphQLResolveInfo) => mixed;

function resolveMaybeThunk<T>(thingOrThunk: Thunk<T>): T {
return typeof thingOrThunk === 'function'
Expand Down Expand Up @@ -100,7 +98,3 @@ export function mutationWithClientMutationId(
},
};
}

function isPromise(value: any): boolean {
return typeof value?.then === 'function';
}
2 changes: 1 addition & 1 deletion src/node/plural.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface PluralIdentifyingRootFieldConfig {
input: any,
context: any,
info: GraphQLResolveInfo,
) => any;
) => unknown;
description?: string;
}

Expand Down
2 changes: 1 addition & 1 deletion src/node/plural.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type PluralIdentifyingRootFieldConfig = {|
input: any,
context: any,
info: GraphQLResolveInfo,
) => ?any,
) => mixed,
description?: string,
|};

Expand Down

0 comments on commit cde9d0e

Please sign in to comment.