Skip to content

Commit

Permalink
Change optimisticResponse type to be consistent and less restrictiv…
Browse files Browse the repository at this point in the history
…e. (#6643)

Per #6390, the extra `| {}` makes certain semantically correct patterns that used to be okay in Typescript 3.7 illegal in 3.9. The difference between the two definitions of `optimisticResponse` in this file appears to have been a simple oversight when they were added in apollographql/react-apollo#3257.
  • Loading branch information
seansfkelley authored Jul 20, 2020
1 parent 9e6c355 commit 8d24498
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/react/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export interface MutationFunctionOptions<
TVariables = OperationVariables
> {
variables?: TVariables;
optimisticResponse?: TData | ((vars: TVariables | {}) => TData);
optimisticResponse?: TData | ((vars: TVariables) => TData);
refetchQueries?: Array<string | PureQueryOptions> | RefetchQueriesFunction;
awaitRefetchQueries?: boolean;
update?: MutationUpdaterFn<TData>;
Expand Down

0 comments on commit 8d24498

Please sign in to comment.