From 9eb5e3e8356a4b61897b5528a83940c9ecef914d Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 13 Sep 2023 15:52:15 +0200 Subject: [PATCH] undo deprecation --- src/core/ApolloClient.ts | 30 +++++------------------------ src/react/hooks/useSuspenseQuery.ts | 6 +----- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 064d6660a19..5feb29f792d 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -586,35 +586,15 @@ export class ApolloClient implements DataProxy { * re-execute any queries then you should make sure to stop watching any * active queries. */ - public refetchQueries>>( - options: RefetchQueriesOptions, TResult> - ): RefetchQueriesResult; - - /** - * @deprecated The two-generics version of refetchQueries is deprecated - * and will be removed in the next major version. - * - * Please use the single-generic version only specifying the return type instead. - * - * The first generic argument of this overload is essentially an - * `cache as any as TCache` - * assertion and does not give you any type safety. - * - * If you rely on a specific cache implementation, please do an `instanceof` check - * in your runtime code to narrow down the type in a type-safe manner. - */ public refetchQueries< - /** @deprecated */ - TCache extends ApolloCache, - TResult, + TCache extends ApolloCache = ApolloCache, + TResult = Promise>, >( options: RefetchQueriesOptions - ): RefetchQueriesResult; - - public refetchQueries( - options: RefetchQueriesOptions, TResult> ): RefetchQueriesResult { - const map = this.queryManager.refetchQueries(options); + const map = this.queryManager.refetchQueries( + options as RefetchQueriesOptions, TResult> + ); const queries: ObservableQuery[] = []; const results: InternalRefetchQueriesResult[] = []; diff --git a/src/react/hooks/useSuspenseQuery.ts b/src/react/hooks/useSuspenseQuery.ts index 80c314fd93c..eb4ca517963 100644 --- a/src/react/hooks/useSuspenseQuery.ts +++ b/src/react/hooks/useSuspenseQuery.ts @@ -26,7 +26,6 @@ import { canonicalStringify } from "../../cache/index.js"; import { skipToken } from "./constants.js"; import type { SkipToken } from "./constants.js"; import type { CacheKey } from "../cache/types.js"; -import { Operation } from "subscriptions-transport-ws"; export interface UseSuspenseQueryResult< TData = unknown, @@ -42,10 +41,7 @@ export interface UseSuspenseQueryResult< } export type FetchMoreFunction = ( - fetchMoreOptions: Omit< - FetchMoreQueryOptions, - "updateQuery" - > & { + fetchMoreOptions: FetchMoreQueryOptions & { updateQuery?: ( previousQueryResult: TData, options: {