Skip to content

Commit acf10c8

Browse files
committed
Fix TypeScript issues
1 parent f3a16d4 commit acf10c8

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/__tests__/starWarsSchema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ const shipMutation = mutationWithClientMutationId({
247247
outputFields: {
248248
ship: {
249249
type: shipType,
250-
resolve: (payload) => getShip(payload.shipId),
250+
resolve: (payload: any) => getShip(payload.shipId),
251251
},
252252
faction: {
253253
type: factionType,

src/mutation/mutation.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ import type {
1414
ThunkObjMap,
1515
} from 'graphql';
1616

17-
type MutationFn<TInput = any, TOutput = unknown, TContext = any> = (object: TInput, ctx: TContext, info: GraphQLResolveInfo) => TOutput;
17+
type MutationFn<TInput = any, TOutput = unknown, TContext = any> = (
18+
object: TInput,
19+
ctx: TContext,
20+
info: GraphQLResolveInfo,
21+
) => TOutput;
1822

1923
/**
2024
* A description of a mutation consumable by mutationWithClientMutationId
@@ -44,9 +48,13 @@ interface MutationConfig<TInput = any, TOutput = unknown, TContext = any> {
4448
* Returns a GraphQLFieldConfig for the mutation described by the
4549
* provided MutationConfig.
4650
*/
47-
export function mutationWithClientMutationId<TInput = any, TOutput = unknown, TContext = any>(
51+
export function mutationWithClientMutationId<
52+
TInput = any,
53+
TOutput = unknown,
54+
TContext = any,
55+
>(
4856
config: MutationConfig<TInput, TOutput, TContext>,
49-
): GraphQLFieldConfig<unknown, unknown> {
57+
): GraphQLFieldConfig<unknown, TContext> {
5058
const { name, inputFields, outputFields, mutateAndGetPayload } = config;
5159
const augmentedInputFields = () => ({
5260
...resolveObjMapThunk(inputFields),

0 commit comments

Comments
 (0)