From 2f197f86d7fbf770bac0cc843cec3378dcc78bc8 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 21 Feb 2019 21:20:09 -0500 Subject: [PATCH] Adjust setQuery updater function call to appease tsc 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. --- packages/apollo-client/src/core/QueryManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/apollo-client/src/core/QueryManager.ts b/packages/apollo-client/src/core/QueryManager.ts index 4486aea32d8..bc68acc2e3c 100644 --- a/packages/apollo-client/src/core/QueryManager.ts +++ b/packages/apollo-client/src/core/QueryManager.ts @@ -1444,7 +1444,7 @@ export class QueryManager { updater: (prev: QueryInfo) => Pick, ) { const prev = this.getQuery(queryId); - const newInfo = { ...prev, ...updater(prev) }; + const newInfo = { ...prev, ...(updater(prev) as object) }; this.queries.set(queryId, newInfo); }