Skip to content

Commit

Permalink
undo deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Sep 13, 2023
1 parent c3a761d commit 9eb5e3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
30 changes: 5 additions & 25 deletions src/core/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,35 +586,15 @@ export class ApolloClient<TCacheShape> implements DataProxy {
* re-execute any queries then you should make sure to stop watching any
* active queries.
*/
public refetchQueries<TResult = Promise<ApolloQueryResult<any>>>(
options: RefetchQueriesOptions<ApolloCache<TCacheShape>, TResult>
): RefetchQueriesResult<TResult>;

/**
* @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<any>,
TResult,
TCache extends ApolloCache<any> = ApolloCache<TCacheShape>,
TResult = Promise<ApolloQueryResult<any>>,
>(
options: RefetchQueriesOptions<TCache, TResult>
): RefetchQueriesResult<TResult>;

public refetchQueries<TResult>(
options: RefetchQueriesOptions<ApolloCache<TCacheShape>, TResult>
): RefetchQueriesResult<TResult> {
const map = this.queryManager.refetchQueries(options);
const map = this.queryManager.refetchQueries(
options as RefetchQueriesOptions<ApolloCache<TCacheShape>, TResult>
);
const queries: ObservableQuery<any>[] = [];
const results: InternalRefetchQueriesResult<TResult>[] = [];

Expand Down
6 changes: 1 addition & 5 deletions src/react/hooks/useSuspenseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -42,10 +41,7 @@ export interface UseSuspenseQueryResult<
}

export type FetchMoreFunction<TData, TVariables extends OperationVariables> = (
fetchMoreOptions: Omit<
FetchMoreQueryOptions<TVariables, TData>,
"updateQuery"
> & {
fetchMoreOptions: FetchMoreQueryOptions<TVariables, TData> & {
updateQuery?: (
previousQueryResult: TData,
options: {
Expand Down

0 comments on commit 9eb5e3e

Please sign in to comment.