Skip to content

Commit

Permalink
Adjust setQuery updater function call to appease tsc
Browse files Browse the repository at this point in the history
The current code is returning a "Spread types may only be
created from object types" error when trying to understand
`{ ...prev, ...updater(prev) }`. This commit makes sure
typescript can tell the result is an object.
  • Loading branch information
hwillson committed Feb 22, 2019
1 parent b793efd commit 2f197f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/apollo-client/src/core/QueryManager.ts
Expand Up @@ -1444,7 +1444,7 @@ export class QueryManager<TStore> {
updater: (prev: QueryInfo) => Pick<QueryInfo, T>,
) {
const prev = this.getQuery(queryId);
const newInfo = { ...prev, ...updater(prev) };
const newInfo = { ...prev, ...(updater(prev) as object) };
this.queries.set(queryId, newInfo);
}

Expand Down

0 comments on commit 2f197f8

Please sign in to comment.