From 3df61a1158b10a94935ef38b2a55ad185221352f Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:12:10 -0600 Subject: [PATCH 01/48] Add deprecation warning for ObservableQuery.result --- src/core/ObservableQuery.ts | 16 ++++++++++++++-- src/utilities/deprecation/index.ts | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index 56cea3bca4b..3339c8f6ecd 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -42,7 +42,11 @@ import { equalByQuery } from "./equalByQuery.js"; import type { TODO } from "../utilities/types/TODO.js"; import type { MaybeMasked, Unmasked } from "../masking/index.js"; import { Slot } from "optimism"; -import { warnRemovedOption } from "../utilities/deprecation/index.js"; +import { + muteDeprecations, + warnDeprecated, + warnRemovedOption, +} from "../utilities/deprecation/index.js"; const { assign, hasOwnProperty } = Object; @@ -218,6 +222,12 @@ export class ObservableQuery< } public result(): Promise>> { + warnDeprecated("observableQuery.result", () => { + invariant.warn( + "[observableQuery.result]: `result` is deprecated and will be removed with Apollo Client 4.0." + ); + }); + return new Promise((resolve, reject) => { // TODO: this code doesn’t actually make sense insofar as the observer // will never exist in this.observers due how zen-observable wraps observables. @@ -731,7 +741,9 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`, // If we have no observers, then we don't actually want to make a network // request. As soon as someone observes the query, the request will kick // off. For now, we just store any changes. (See #1077) - return this.observers.size ? this.result() : Promise.resolve(); + return this.observers.size ? + muteDeprecations("observableQuery.result", () => this.result()) + : Promise.resolve(); } this.options.variables = variables; diff --git a/src/utilities/deprecation/index.ts b/src/utilities/deprecation/index.ts index 28e4eb3e5b4..755ec276239 100644 --- a/src/utilities/deprecation/index.ts +++ b/src/utilities/deprecation/index.ts @@ -14,6 +14,7 @@ type DeprecationName = | "canonizeResults" | "connectToDevTools" | "graphql" + | "observableQuery.result" | "parser" | "withQuery" | "withMutation" From 7a68a91c8b412a2c585c4908688ce3d396e4b524 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:16:07 -0600 Subject: [PATCH 02/48] Wrap in dev --- src/core/ObservableQuery.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index 3339c8f6ecd..1c8ccd1eab7 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -222,11 +222,13 @@ export class ObservableQuery< } public result(): Promise>> { - warnDeprecated("observableQuery.result", () => { - invariant.warn( - "[observableQuery.result]: `result` is deprecated and will be removed with Apollo Client 4.0." - ); - }); + if (__DEV__) { + warnDeprecated("observableQuery.result", () => { + invariant.warn( + "[observableQuery.result]: `result` is deprecated and will be removed with Apollo Client 4.0." + ); + }); + } return new Promise((resolve, reject) => { // TODO: this code doesn’t actually make sense insofar as the observer From afe93dcb4ed458be7ec4f69c038a40e25a0cb4ba Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:18:24 -0600 Subject: [PATCH 03/48] Add deprecation and warning for setOptions --- src/core/ObservableQuery.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index 1c8ccd1eab7..458e38360cc 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -701,11 +701,20 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`, }; } + /** + * @deprecated `setOptions` will be removed in Apollo Client 4.0. Please use + * `observableQuery.reobserve(newOptions)` instead. + */ public setOptions( newOptions: Partial> ): Promise>> { if (__DEV__) { warnRemovedOption(newOptions, "canonizeResults", "setOptions"); + warnDeprecated("setOptions", () => { + invariant.warn( + "[observableQuery.setOptions] `setOptions` is deprecated and will be removed in Apollo Client 4.0. Please use `observableQuery.reobserve(newOptions)` instead." + ); + }); } return this.reobserve(newOptions); From 6eb6638f0b080fc1b4ab061727a3812653fc7642 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:21:58 -0600 Subject: [PATCH 04/48] Add deprecation for result --- src/core/ObservableQuery.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index 458e38360cc..1f5ff8095ec 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -221,6 +221,22 @@ export class ObservableQuery< this.queryName = opDef && opDef.name && opDef.name.value; } + /** + * @deprecated `result` will be removed in Apollo Client 4.0. + * + * **Recommended now** + * + * If you continue to need this functionality, subscribe to `ObservableQuery` + * to get the first value emitted from the observable, then immediately unsubscribe. + * + * **When upgrading** + * + * Use RxJS's [`firstResultFrom`](https://rxjs.dev/api/index/function/firstValueFrom) function to mimic this functionality. + * + * ```ts + * const result = await firstValueFrom(from(observableQuery)); + * ``` + */ public result(): Promise>> { if (__DEV__) { warnDeprecated("observableQuery.result", () => { From b3d778b73478c78f7d545ec75e842fba7a8f287f Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:27:55 -0600 Subject: [PATCH 05/48] Add deprecation and warning for resetQueryStoreErrors --- src/core/ObservableQuery.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index 1f5ff8095ec..ba9acec0ae7 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -438,7 +438,17 @@ export class ObservableQuery< this.isTornDown = false; } + /** + * @deprecated `resetQueryStoreErrors` will be removed in Apollo Client 4.0. + * Please discontinue using this method. + */ public resetQueryStoreErrors() { + if (__DEV__) { + invariant.warn( + "[observableQuery.resetQueryStoreErrors]: `resetQueryStoreErrors` is deprecated and will be removed with Apollo Client 4.0. Please discontinue using this method." + ); + } + this.queryManager.resetErrors(this.queryId); } From 1a88856578c3abfa9bda6e1827239274533a41fb Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:34:17 -0600 Subject: [PATCH 06/48] Add deprecation on urql helper --- src/utilities/subscriptions/urql/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utilities/subscriptions/urql/index.ts b/src/utilities/subscriptions/urql/index.ts index a8f195562ec..e1b2387ac21 100644 --- a/src/utilities/subscriptions/urql/index.ts +++ b/src/utilities/subscriptions/urql/index.ts @@ -11,6 +11,11 @@ import type { CreateMultipartSubscriptionOptions } from "../shared.js"; const backupFetch = maybe(() => fetch); +/** + * @deprecated `createFetchMultipartSubscription` will be removed in Apollo + * Client 4.0. `urql` has native support for Apollo multipart subscriptions and + * should be used instead. + */ export function createFetchMultipartSubscription( uri: string, { fetch: preferredFetch, headers }: CreateMultipartSubscriptionOptions = {} From 4a4d6c268f35fd4964e93271e1fcbdcd9b590fff Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:35:55 -0600 Subject: [PATCH 07/48] Add deprecation on subscribeAndCount --- src/testing/core/subscribeAndCount.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/testing/core/subscribeAndCount.ts b/src/testing/core/subscribeAndCount.ts index 4b366193b53..94e06b7cd27 100644 --- a/src/testing/core/subscribeAndCount.ts +++ b/src/testing/core/subscribeAndCount.ts @@ -4,6 +4,10 @@ import type { } from "../../utilities/index.js"; import { asyncMap } from "../../utilities/index.js"; +/** + * @deprecated `subscribeAndCount` will be removed in Apollo Client 4.0. Please + * discontinue using this function. + */ export default function subscribeAndCount( reject: (reason: any) => any, observable: Observable, From 82640174d5f02ffb0c71af0ad7083c0892a4178c Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:39:29 -0600 Subject: [PATCH 08/48] Add deprecation to throwServerError --- src/link/utils/throwServerError.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/link/utils/throwServerError.ts b/src/link/utils/throwServerError.ts index 67b34946a05..dfdb3adbf4d 100644 --- a/src/link/utils/throwServerError.ts +++ b/src/link/utils/throwServerError.ts @@ -4,6 +4,23 @@ export type ServerError = Error & { statusCode: number; }; +/** + * @deprecated `throwServerError` will be removed in Apollo Client 4.0. This is + * safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When migrating** + * + * `ServerError` is a subclass of `Error`. To throw a server error, use + * `throw new ServerError(...)` instead. + * + * ```ts + * throw new ServerError("error message", { response, result }); + * ``` + */ export const throwServerError = ( response: Response, result: any, From ab13aeee047f580ef870a26c185c78530383b7e1 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:39:40 -0600 Subject: [PATCH 09/48] Add deprecation for toPromise/fromPromise --- src/link/utils/fromPromise.ts | 16 ++++++++++++++++ src/link/utils/toPromise.ts | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/link/utils/fromPromise.ts b/src/link/utils/fromPromise.ts index 01abb20b426..aafaa88c49b 100644 --- a/src/link/utils/fromPromise.ts +++ b/src/link/utils/fromPromise.ts @@ -1,5 +1,21 @@ import { Observable } from "../../utilities/index.js"; +/** + * @deprecated `fromPromise` will be removed in Apollo Client 4.0. This is safe + * to use in 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When upgrading** + * + * Use RxJS's [`from`](https://rxjs.dev/api/index/function/from) function. + * + * ```ts + * const observable = from(promise); + * ``` + */ export function fromPromise(promise: Promise): Observable { return new Observable((observer) => { promise diff --git a/src/link/utils/toPromise.ts b/src/link/utils/toPromise.ts index c75e5169bd8..b151d42c9d8 100644 --- a/src/link/utils/toPromise.ts +++ b/src/link/utils/toPromise.ts @@ -1,6 +1,22 @@ import { invariant } from "../../utilities/globals/index.js"; import type { Observable } from "../../utilities/index.js"; +/** + * @deprecated `toPromise` will be removed in Apollo Client 4.0. This is safe + * to use in 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When upgrading** + * + * Use RxJS's [`firstValueFrom`](https://rxjs.dev/api/index/function/firstValueFrom) function. + * + * ```ts + * const result = await firstValueFrom(observable); + * ``` + */ export function toPromise(observable: Observable): Promise { let completed = false; return new Promise((resolve, reject) => { From 321cbad3c692e643b2bc9079c7f59078031b3279 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:41:38 -0600 Subject: [PATCH 10/48] Add deprecation for itAsync --- src/testing/core/itAsync.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/testing/core/itAsync.ts b/src/testing/core/itAsync.ts index fc664cbac07..6cefdf84d10 100644 --- a/src/testing/core/itAsync.ts +++ b/src/testing/core/itAsync.ts @@ -20,6 +20,11 @@ function wrap(key?: "only" | "skip" | "todo") { const wrappedIt = wrap(); +/** + * @deprecated `itAsync` will be removed with Apollo Client 4.0. Prefer using an + * `async` callback function or returning a `Promise` from the callback with the + * `it` or `test` functions. + */ export const itAsync = Object.assign( function (this: unknown, ...args: Parameters) { return wrappedIt.apply(this, args); From 7bb198a0a696b362166f27fd6b6051d253b06168 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:45:16 -0600 Subject: [PATCH 11/48] Add deprecation for fromError --- src/link/utils/fromError.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/link/utils/fromError.ts b/src/link/utils/fromError.ts index be91da323b8..e61d39eb940 100644 --- a/src/link/utils/fromError.ts +++ b/src/link/utils/fromError.ts @@ -1,5 +1,21 @@ import { Observable } from "../../utilities/index.js"; +/** + * @deprecated `fromError` will be removed in Apollo Client 4.0. This is safe + * to use in 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When upgrading** + * + * Use RxJS's [`throwError`](https://rxjs.dev/api/index/function/throwError) function. + * + * ```ts + * const observable = throwError(() => new Error(...)); + * ``` + */ export function fromError(errorValue: any): Observable { return new Observable((observer) => { observer.error(errorValue); From 36d69c36e332e69e27ccb2ee3ea10a2b775b45c0 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:47:15 -0600 Subject: [PATCH 12/48] Add deprecation for iterateObserversSafely --- src/utilities/observables/iteration.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utilities/observables/iteration.ts b/src/utilities/observables/iteration.ts index 19bb56b23c6..35781e578c4 100644 --- a/src/utilities/observables/iteration.ts +++ b/src/utilities/observables/iteration.ts @@ -1,5 +1,9 @@ import type { Observer } from "./Observable.js"; +/** + * @deprecated `iterateObserversSafely` will be removed with Apollo Client 4.0. + * Please discontinue using this function. + */ export function iterateObserversSafely( observers: Set>, method: keyof Observer, From 5f009d69c5d790dd248908907cc83fdb795f72c2 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:50:04 -0600 Subject: [PATCH 13/48] Deprecate isApolloError --- src/errors/index.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/errors/index.ts b/src/errors/index.ts index 981e461dd1b..da943c855ea 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -42,6 +42,25 @@ export function graphQLResultHasProtocolErrors( return false; } +/** + * @deprecated `isApolloError` will be removed with Apollo Client 4.0. This + * function is safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When migrating** + * + * Errors are no longer wrapped in Apollo Client 4.0. To check if an error is an + * instance of an error provided by Apollo Client, use the static `.is` methods + * on the error class you want to test against. + * + * ```ts + * // Test if an error is an instance of `CombinedGraphQLErrors` + * const isGraphQLErrors = CombinedGraphQLErrors.is(error); + * ```` + */ export function isApolloError(err: Error): err is ApolloError { return err.hasOwnProperty("graphQLErrors"); } From 107d8623bc5532fbe5ae10846f7974e1d5148fda Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:52:06 -0600 Subject: [PATCH 14/48] Add deprecation for asyncMap --- src/utilities/observables/asyncMap.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/utilities/observables/asyncMap.ts b/src/utilities/observables/asyncMap.ts index dff4620d06b..69f7ea6f964 100644 --- a/src/utilities/observables/asyncMap.ts +++ b/src/utilities/observables/asyncMap.ts @@ -3,6 +3,19 @@ import { Observable } from "./Observable.js"; // Like Observable.prototype.map, except that the mapping function can // optionally return a Promise (or be async). +/** + * @deprecated `asyncMap` will be removed in Apollo Client 4.0. This function is + * safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When migrating** + * + * Prefer to use RxJS's built in helpers. Convert promises into observables + * using the [`from`](https://rxjs.dev/api/index/function/from) function. + */ export function asyncMap( observable: Observable, mapFn: (value: V) => R | PromiseLike, From d80fa0bb4d364553381cc59927819f320232b53e Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:54:42 -0600 Subject: [PATCH 15/48] Add warning for `resetResultIdentities` --- src/cache/inmemory/inMemoryCache.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/cache/inmemory/inMemoryCache.ts b/src/cache/inmemory/inMemoryCache.ts index 9bd7010e556..ba6b2d2882a 100644 --- a/src/cache/inmemory/inMemoryCache.ts +++ b/src/cache/inmemory/inMemoryCache.ts @@ -336,8 +336,25 @@ export class InMemoryCache extends ApolloCache { // If resetResultCache is true, this.storeReader.canon will be preserved by // default, but can also be discarded by passing resetResultIdentities:true. // Defaults to false. + /** + * @deprecated `resetResultIdentities` is removed in Apollo Client 4.0. + * + * **Recommended now** + * + * Ensure all usages of `canonizeResults` are removed. Once + * `canonizeResults` is no longer used, remove this option. + */ resetResultIdentities?: boolean; }) { + if (__DEV__) { + warnRemovedOption( + options || {}, + "resetResultIdentities", + "cache.gc", + "First ensure all usages of `canonizeResults` are removed, then remove this option." + ); + } + canonicalStringify.reset(); print.reset(); const ids = this.optimisticData.gc(); From db98bcb41a8ccd2282ee5a42e143f1fd40438e4c Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 16:56:12 -0600 Subject: [PATCH 16/48] Add default any for TCacheShape generic on ApolloClient --- src/core/ApolloClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 56e1b1f1e9e..99e626dcb20 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -304,7 +304,7 @@ export { mergeOptions }; * receive results from the server and cache the results in a store. It also delivers updates * to GraphQL queries through `Observable` instances. */ -export class ApolloClient implements DataProxy { +export class ApolloClient implements DataProxy { public link: ApolloLink; public cache: ApolloCache; From 6182014c8a82bded3bf92a4c17a8a79f0dee074c Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:01:42 -0600 Subject: [PATCH 17/48] Deprecate shared base types --- src/core/watchQueryOptions.ts | 9 ++++++++ src/react/types/types.ts | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/core/watchQueryOptions.ts b/src/core/watchQueryOptions.ts index f03448a73a0..0fde1f2ad3b 100644 --- a/src/core/watchQueryOptions.ts +++ b/src/core/watchQueryOptions.ts @@ -343,6 +343,15 @@ export interface MutationOptions< /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#mutation:member} */ mutation: DocumentNode | TypedDocumentNode; } + +/** + * @deprecated `MutationSharedOptions` will be removed in Apollo Client 4.0. Types + * have been flattened in 4.0 and no longer extend this base type. + * + * **Recommended now** + * + * Copy all properties from this type into your type. + */ export interface MutationSharedOptions< TData = any, TVariables = OperationVariables, diff --git a/src/react/types/types.ts b/src/react/types/types.ts index 5713ed7379f..2530dbbe395 100644 --- a/src/react/types/types.ts +++ b/src/react/types/types.ts @@ -51,6 +51,14 @@ export type CommonOptions = TOptions & { /* Query types */ +/** + * @deprecated `BaseQueryOptions` will be removed in Apollo Client 4.0. Types + * have been flattened in 4.0 and no longer extend this base type. + * + * **Recommended now** + * + * Copy all properties from this type into your type. + */ export interface BaseQueryOptions< TVariables extends OperationVariables = OperationVariables, TData = any, @@ -63,6 +71,14 @@ export interface BaseQueryOptions< context?: DefaultContext; } +/** + * @deprecated `QueryFunctionOptions` will be removed in Apollo Client 4.0. Types + * have been flattened in 4.0 and no longer extend this base type. + * + * **Recommended now** + * + * Copy all properties from this type into your type. + */ export interface QueryFunctionOptions< TData = any, TVariables extends OperationVariables = OperationVariables, @@ -93,6 +109,14 @@ export interface QueryFunctionOptions< defaultOptions?: Partial>; } +/** + * @deprecated `ObservableQueryFields` will be removed in Apollo Client 4.0. + * Types have been flattened in 4.0 and no longer extend this base type. + * + * **Recommended now** + * + * Copy all properties from this type into your type. + */ export interface ObservableQueryFields< TData, TVariables extends OperationVariables, @@ -562,6 +586,14 @@ export type RefetchQueriesFunction = ( ...args: any[] ) => InternalRefetchQueriesInclude; +/** + * @deprecated `BaseMutationOptions` will be removed in Apollo Client 4.0. Types + * have been flattened in 4.0 and no longer extend this base type. + * + * **Recommended now** + * + * Copy all properties from this type into your type. + */ export interface BaseMutationOptions< TData = any, TVariables = OperationVariables, @@ -666,6 +698,14 @@ export interface OnSubscriptionDataOptions { subscriptionData: SubscriptionResult; } +/** + * @deprecated `BaseSubscriptionOptions` will be removed in Apollo Client 4.0. + * Types have been flattened in 4.0 and no longer extend this base type. + * + * **Recommended now** + * + * Copy all properties from this type into your type. + */ export interface BaseSubscriptionOptions< TData = any, TVariables extends OperationVariables = OperationVariables, From 657dae165a76849876da035ee5c4dea9b4d35f22 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:07:49 -0600 Subject: [PATCH 18/48] Use InteropApolloQueryResult for refetchQueries --- src/core/ApolloClient.ts | 2 +- src/core/types.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 99e626dcb20..2fecdea6a4c 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -958,7 +958,7 @@ export class ApolloClient implements DataProxy { */ public refetchQueries< TCache extends ApolloCache = ApolloCache, - TResult = Promise>, + TResult = Promise>, >( options: RefetchQueriesOptions ): RefetchQueriesResult { diff --git a/src/core/types.ts b/src/core/types.ts index 4d907f7ab64..478bb91741d 100644 --- a/src/core/types.ts +++ b/src/core/types.ts @@ -78,7 +78,7 @@ export type RefetchQueriesPromiseResults = // query (false). Since refetching produces an ApolloQueryResult, and // skipping produces nothing, the fully-resolved array of all results produced // will be an ApolloQueryResult[], when TResult extends boolean. - TResult extends boolean ? ApolloQueryResult[] + TResult extends boolean ? InteropApolloQueryResult[] : // If onQueryUpdated returns a PromiseLike, that thenable will be passed as // an array element to Promise.all, so we infer/unwrap the array type U here. TResult extends PromiseLike ? U[] @@ -121,7 +121,7 @@ export type InternalRefetchQueriesResult = // If onQueryUpdated returns a boolean, that's equivalent to refetching the // query when the boolean is true and skipping the query when false, so the // internal type of refetched results is Promise>. - TResult extends boolean ? Promise> + TResult extends boolean ? Promise> : // Otherwise, onQueryUpdated returns whatever it returns. If onQueryUpdated is // not provided, TResult defaults to Promise> (see the // generic type parameters of client.refetchQueries). From 797bcf2fa4a470c37d083a3135590452cf575087 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:08:40 -0600 Subject: [PATCH 19/48] Use InteropApolloQueryResult for reFetchObservableQueries --- src/core/ApolloClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 2fecdea6a4c..216c84b98c5 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -941,7 +941,7 @@ export class ApolloClient implements DataProxy { */ public reFetchObservableQueries( includeStandby?: boolean - ): Promise[]> { + ): Promise[]> { return this.queryManager.reFetchObservableQueries(includeStandby); } From cd73dd4a6447f7873f6226a42e3dbec9e711a908 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:09:06 -0600 Subject: [PATCH 20/48] Use InteropApolloQueryResult for resetStore --- src/core/ApolloClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 216c84b98c5..b58c0d7f00c 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -874,7 +874,7 @@ export class ApolloClient implements DataProxy { * re-execute any queries then you should make sure to stop watching any * active queries. */ - public resetStore(): Promise[] | null> { + public resetStore(): Promise[] | null> { return Promise.resolve() .then(() => this.queryManager.clearStore({ From 5b2a9a7ecf644abe60331167f6d0f62b7eda7064 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:18:21 -0600 Subject: [PATCH 21/48] Remove unused import --- src/core/ApolloClient.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index b58c0d7f00c..4e7e5166b89 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -15,7 +15,6 @@ import { QueryManager } from "./QueryManager.js"; import type { ObservableQuery } from "./ObservableQuery.js"; import type { - ApolloQueryResult, DefaultContext, OperationVariables, Resolvers, From f686918e4b23bdf67dc732bc1f0d937cf759e9c3 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:20:32 -0600 Subject: [PATCH 22/48] Add deprecation and warning for newData --- src/testing/core/mocking/mockLink.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/testing/core/mocking/mockLink.ts b/src/testing/core/mocking/mockLink.ts index dfae6ed60b0..f1e5a33818d 100644 --- a/src/testing/core/mocking/mockLink.ts +++ b/src/testing/core/mocking/mockLink.ts @@ -49,6 +49,12 @@ export interface MockedResponse< error?: Error; delay?: number; variableMatcher?: VariableMatcher; + /** + * @deprecated `newData` will be removed in Apollo Client 4.0. Please use the + * `result` option with a callback function instead and provide a + * `maxUsageCount` of `Number.POSITIVE_INFINITY` to get the same behavior. + * ``` + */ newData?: ResultFunction>, TVariables>; } @@ -163,7 +169,14 @@ ${unmatchedVars.map((d) => ` ${stringifyForDebugging(d)}`).join("\n")} mockedResponses.splice(responseIndex, 1); } const { newData } = response; + if (newData) { + if (__DEV__) { + invariant.warn( + "[MockLink]: `newData` is deprecated and will be removed in Apollo Client 4.0. Please use the `result` option with a callback function and set the `maxUsageCount` option to `Number.POSITIVE_INFINITY`.\n\nFound `newData` on response:\n%o", + response + ); + } response.result = newData(operation.variables); mockedResponses.push(response); } From 10746c6cddf77c2338d9ac8ea616f212e08e599f Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:27:10 -0600 Subject: [PATCH 23/48] Warn if using a client-only query --- src/testing/core/mocking/mockLink.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/testing/core/mocking/mockLink.ts b/src/testing/core/mocking/mockLink.ts index f1e5a33818d..3b43caaa631 100644 --- a/src/testing/core/mocking/mockLink.ts +++ b/src/testing/core/mocking/mockLink.ts @@ -20,6 +20,7 @@ import { removeDirectivesFromDocument, checkDocument, makeUniqueId, + getOperationName, } from "../../../utilities/index.js"; import type { Unmasked } from "../../../masking/index.js"; @@ -188,6 +189,21 @@ ${unmatchedVars.map((d) => ` ${stringifyForDebugging(d)}`).join("\n")} } } + if (__DEV__) { + if (response?.request.query) { + const serverQuery = removeClientSetsFromDocument( + response?.request.query + ); + + if (!serverQuery) { + invariant.warn( + "[MockLink]: Apollo Client 4.0 will throw when mocking client-only query '%s'. Please ensure the query has at least 1 non-client field.", + getOperationName(response.request.query) ?? "(anonymous)" + ); + } + } + } + return new Observable((observer) => { const timer = setTimeout(() => { if (configError) { From ca1d8d68b629465989e2fe4861e3a4b3718f2497 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:29:44 -0600 Subject: [PATCH 24/48] Add warning/deprecation for onError/setOnError in ApolloLink --- src/link/core/ApolloLink.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/link/core/ApolloLink.ts b/src/link/core/ApolloLink.ts index 4f7759915d6..51f964b72a3 100644 --- a/src/link/core/ApolloLink.ts +++ b/src/link/core/ApolloLink.ts @@ -136,10 +136,19 @@ export class ApolloLink { throw newInvariantError("request is not implemented"); } + /** + * @deprecated `onError` will be removed with Apollo Client 4.0. Please + * discontinue using this method. + */ protected onError( error: any, observer?: Observer ): false | void { + if (__DEV__) { + invariant.warn( + "[ApolloLink] `onError` is deprecated and will be removed with Apollo Client 4.0. Please discontinue using it." + ); + } if (observer && observer.error) { observer.error(error); // Returning false indicates that observer.error does not need to be @@ -154,7 +163,16 @@ export class ApolloLink { throw error; } + /** + * @deprecated `setOnError` will be removed with Apollo Client 4.0. Please + * discontinue using this method. + */ public setOnError(fn: ApolloLink["onError"]): this { + if (__DEV__) { + invariant.warn( + "[ApolloLink] `setOnError` is deprecated and will be removed with Apollo Client 4.0. Please discontinue using it." + ); + } this.onError = fn; return this; } From e6c99e9a8085087da7456cc6debf66e590073652 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:32:49 -0600 Subject: [PATCH 25/48] Add deprecations for error properties in onError link --- src/link/error/index.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/link/error/index.ts b/src/link/error/index.ts index 4b0de084428..b1b0aa6eeb3 100644 --- a/src/link/error/index.ts +++ b/src/link/error/index.ts @@ -12,17 +12,53 @@ import { ApolloLink } from "../core/index.js"; export interface ErrorResponse { /** * Errors returned in the `errors` property of the GraphQL response. + * + * @deprecated `graphQLErrors` will no longer available in options in Apollo Client 4.0. + * This value is safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When upgrading** + * + * `graphQLErrors` has been consolidated to the `error` property. You will need to + * read the error from the `error` property. */ graphQLErrors?: ReadonlyArray; /** * Errors thrown during a network request. This is usually an error thrown * during a `fetch` call or an error while parsing the response from the * network. + * + * @deprecated `networkError` will no longer available in options in Apollo Client 4.0. + * This value is safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When upgrading** + * + * `networkError` has been consolidated to the `error` property. You will need to + * read the error from the `error` property. */ networkError?: NetworkError; /** * Fatal transport-level errors from multipart subscriptions. * See the [multipart subscription protocol](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol#message-and-error-format) for more information. + * + * @deprecated `protocolErrors` will no longer available in options in Apollo Client 4.0. + * This value is safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When upgrading** + * + * `protocolErrors` has been consolidated to the `error` property. You will need to + * read the error from the `error` property. */ protocolErrors?: ReadonlyArray; response?: FormattedExecutionResult; From 75d939299c026249009ebea3b97170263aed1117 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:35:47 -0600 Subject: [PATCH 26/48] Warn for notifyOnNetworkStatusChange for client.query --- src/core/ApolloClient.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 4e7e5166b89..2b658e8e71f 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -681,6 +681,12 @@ export class ApolloClient implements DataProxy { if (__DEV__) { warnRemovedOption(options, "canonizeResults", "client.query"); + warnRemovedOption( + options, + "notifyOnNetworkStatusChange", + "client.query", + "This option does not affect `client.query` and can be safely removed." + ); if (options.fetchPolicy === "standby") { invariant.warn( From af5976b60892f678e2bc03ee61591959dbee9de1 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:40:04 -0600 Subject: [PATCH 27/48] Adjust deprecation message --- src/testing/experimental/createSchemaFetch.ts | 2 +- src/testing/experimental/createTestSchema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testing/experimental/createSchemaFetch.ts b/src/testing/experimental/createSchemaFetch.ts index c8eb9374759..ae82ff516cd 100644 --- a/src/testing/experimental/createSchemaFetch.ts +++ b/src/testing/experimental/createSchemaFetch.ts @@ -30,7 +30,7 @@ import { wait } from "../core/wait.js"; * ``` * @since 3.10.0 * @alpha - * @deprecated `createSchemaFetch` is deprecated and will be removed in 3.12.0. + * @deprecated `createSchemaFetch` is deprecated and will be removed in Apollo Client 4.0. * Please migrate to [`@apollo/graphql-testing-library`](https://github.com/apollographql/graphql-testing-library). */ const createSchemaFetch = ( diff --git a/src/testing/experimental/createTestSchema.ts b/src/testing/experimental/createTestSchema.ts index e07dd923e4e..5546d8d3cf8 100644 --- a/src/testing/experimental/createTestSchema.ts +++ b/src/testing/experimental/createTestSchema.ts @@ -50,7 +50,7 @@ interface TestSchemaOptions { * ``` * @since 3.9.0 * @alpha - * @deprecated `createTestSchema` is deprecated and will be removed in 3.12.0. + * @deprecated `createTestSchema` is deprecated and will be removed in Apollo Client 4.0. * Please migrate to [`@apollo/graphql-testing-library`](https://github.com/apollographql/graphql-testing-library). */ const createTestSchema = ( From fc8144fee02409c7ae46e0621ca23ea948b517dc Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:43:56 -0600 Subject: [PATCH 28/48] Add warning for client queries in http/batch http link --- src/link/batch-http/batchHttpLink.ts | 9 +++++++++ src/link/http/createHttpLink.ts | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/link/batch-http/batchHttpLink.ts b/src/link/batch-http/batchHttpLink.ts index d0412f68cf2..329cd686b6a 100644 --- a/src/link/batch-http/batchHttpLink.ts +++ b/src/link/batch-http/batchHttpLink.ts @@ -19,6 +19,7 @@ import { } from "../http/index.js"; import { BatchLink } from "../batch/index.js"; import { filterOperationVariables } from "../utils/filterOperationVariables.js"; +import { invariant } from "../../utilities/globals/index.js"; export namespace BatchHttpLink { export type Options = Pick< @@ -101,6 +102,14 @@ export class BatchHttpLink extends ApolloLink { headers: { ...clientAwarenessHeaders, ...context.headers }, }; + if (__DEV__) { + if (operations.some(({ query }) => hasDirectives(["client"], query))) { + invariant.warn( + "[BatchHttpLink]: Apollo Client 4.0 will no longer remove `@client` fields from queries sent through the link chain. Please open an issue if this warning is displayed under standard usage." + ); + } + } + const queries = operations.map(({ query }) => { if (hasDirectives(["client"], query)) { return removeClientSetsFromDocument(query); diff --git a/src/link/http/createHttpLink.ts b/src/link/http/createHttpLink.ts index 8c51b113a2a..98441120169 100644 --- a/src/link/http/createHttpLink.ts +++ b/src/link/http/createHttpLink.ts @@ -90,6 +90,11 @@ export const createHttpLink = (linkOptions: HttpOptions = {}) => { }; if (hasDirectives(["client"], operation.query)) { + if (__DEV__) { + invariant.warn( + "[HttpLink]: Apollo Client 4.0 will no longer remove `@client` fields from queries sent through the link chain. Please open an issue if this warning is displayed under standard usage." + ); + } const transformedQuery = removeClientSetsFromDocument(operation.query); if (!transformedQuery) { From 5c31aa5f477abc3def54cf6fa3fecd1f946ab931 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:47:25 -0600 Subject: [PATCH 29/48] Add deprecations for getLastResult, getLastError, and resetLastResults --- src/core/ObservableQuery.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index ba9acec0ae7..1c5e20daa3b 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -423,16 +423,28 @@ export class ObservableQuery< } } + /** + * @deprecated `getLastResult` will be removed in Apollo Client 4.0. Please + * discontinue using this method. + */ public getLastResult( variablesMustMatch?: boolean ): ApolloQueryResult | undefined { return this.getLast("result", variablesMustMatch); } + /** + * @deprecated `getLastError` will be removed in Apollo Client 4.0. Please + * discontinue using this method. + */ public getLastError(variablesMustMatch?: boolean): ApolloError | undefined { return this.getLast("error", variablesMustMatch); } + /** + * @deprecated `resetLastResults` will be removed in Apollo Client 4.0. Please + * discontinue using this method. + */ public resetLastResults(): void { delete this.last; this.isTornDown = false; From 463e7e26b8233aac6e5cfe3e6614b14d0e112a44 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:51:52 -0600 Subject: [PATCH 30/48] Add warnings for getLastResult, getLastError, and resetLastResults --- src/core/ObservableQuery.ts | 37 +++++++++++++++++++--- src/core/QueryInfo.ts | 9 +++++- src/core/QueryManager.ts | 4 ++- src/react/internal/cache/QueryReference.ts | 5 ++- src/utilities/deprecation/index.ts | 3 ++ 5 files changed, 50 insertions(+), 8 deletions(-) diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index 1c5e20daa3b..fd541fabd90 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -288,7 +288,9 @@ export class ObservableQuery< saveAsLastResult = true ): ApolloQueryResult { // Use the last result as long as the variables match this.variables. - const lastResult = this.getLastResult(true); + const lastResult = muteDeprecations("getLastResult", () => + this.getLastResult(true) + ); const networkStatus = this.queryInfo.networkStatus || @@ -430,6 +432,13 @@ export class ObservableQuery< public getLastResult( variablesMustMatch?: boolean ): ApolloQueryResult | undefined { + if (__DEV__) { + warnDeprecated("getLastResult", () => { + invariant.warn( + "[ObservableQuery]: `getLastResult` is deprecated and will be removed in Apollo Client 4.0. Please discontinue using this method." + ); + }); + } return this.getLast("result", variablesMustMatch); } @@ -438,6 +447,13 @@ export class ObservableQuery< * discontinue using this method. */ public getLastError(variablesMustMatch?: boolean): ApolloError | undefined { + if (__DEV__) { + warnDeprecated("getLastError", () => { + invariant.warn( + "[ObservableQuery]: `getLastResult` is deprecated and will be removed in Apollo Client 4.0. Please discontinue using this method." + ); + }); + } return this.getLast("error", variablesMustMatch); } @@ -446,6 +462,13 @@ export class ObservableQuery< * discontinue using this method. */ public resetLastResults(): void { + if (__DEV__) { + warnDeprecated("resetLastResults", () => { + invariant.warn( + "[ObservableQuery]: `getLastResult` is deprecated and will be removed in Apollo Client 4.0. Please discontinue using this method." + ); + }); + } delete this.last; this.isTornDown = false; } @@ -993,7 +1016,9 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`, newResult: ApolloQueryResult, variables = this.variables ) { - let error: ApolloError | undefined = this.getLastError(); + let error: ApolloError | undefined = muteDeprecations("getLastError", () => + this.getLastError() + ); // Preserve this.last.error unless the variables have changed. if (error && this.last && !equal(variables, this.last.variables)) { error = void 0; @@ -1147,7 +1172,7 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`, // the subscription, and restore the last value afterwards so that the // subscription has a chance to stay open. const last = this.last; - this.resetLastResults(); + muteDeprecations("resetLastResults", () => this.resetLastResults()); const subscription = this.subscribe(...args); this.last = last; @@ -1172,7 +1197,9 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`, result: ApolloQueryResult, variables: TVariables | undefined ) { - const lastError = this.getLastError(); + const lastError = muteDeprecations("getLastError", () => + this.getLastError() + ); const isDifferent = this.isDifferentFromLastResult(result, variables); // Update the last result even when isDifferentFromLastResult returns false, // because the query may be using the @nonreactive directive, and we want to @@ -1190,7 +1217,7 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`, // Since we don't get the current result on errors, only the error, we // must mirror the updates that occur in QueryStore.markQueryError here const errorResult = { - ...this.getLastResult(), + ...muteDeprecations("getLastResult", () => this.getLastResult()), error, errors: error.graphQLErrors, networkStatus: NetworkStatus.error, diff --git a/src/core/QueryInfo.ts b/src/core/QueryInfo.ts index 3118229fe95..d94f0de3adf 100644 --- a/src/core/QueryInfo.ts +++ b/src/core/QueryInfo.ts @@ -208,7 +208,14 @@ export class QueryInfo { // // See https://github.com/apollographql/apollo-client/issues/11400 for more // information on this issue. - if (diff && !diff.complete && this.observableQuery?.getLastError()) { + if ( + diff && + !diff.complete && + muteDeprecations( + "getLastError", + () => this.observableQuery?.getLastError() + ) + ) { return; } diff --git a/src/core/QueryManager.ts b/src/core/QueryManager.ts index 429fef6194c..6699345606e 100644 --- a/src/core/QueryManager.ts +++ b/src/core/QueryManager.ts @@ -1009,7 +1009,9 @@ export class QueryManager { this.getObservableQueries(includeStandby ? "all" : "active").forEach( (observableQuery, queryId) => { const { fetchPolicy } = observableQuery.options; - observableQuery.resetLastResults(); + muteDeprecations("resetLastResults", () => + observableQuery.resetLastResults() + ); if ( includeStandby || (fetchPolicy !== "standby" && fetchPolicy !== "cache-only") diff --git a/src/react/internal/cache/QueryReference.ts b/src/react/internal/cache/QueryReference.ts index 19c288ebb66..bc1bd3f5c59 100644 --- a/src/react/internal/cache/QueryReference.ts +++ b/src/react/internal/cache/QueryReference.ts @@ -18,6 +18,7 @@ import type { QueryKey } from "./types.js"; import { wrapPromiseWithState } from "../../../utilities/index.js"; import { invariant } from "../../../utilities/globals/invariantWrappers.js"; import type { MaybeMasked } from "../../../masking/index.js"; +import { muteDeprecations } from "../../../utilities/deprecation/index.js"; type QueryRefPromise = PromiseWithState< ApolloQueryResult> @@ -287,7 +288,9 @@ export class InternalQueryReference { if (avoidNetworkRequests) { observable.silentSetOptions({ fetchPolicy: "standby" }); } else { - observable.resetLastResults(); + muteDeprecations("resetLastResults", () => + observable.resetLastResults() + ); observable.silentSetOptions({ fetchPolicy: "cache-first" }); } diff --git a/src/utilities/deprecation/index.ts b/src/utilities/deprecation/index.ts index 755ec276239..21ce78c628b 100644 --- a/src/utilities/deprecation/index.ts +++ b/src/utilities/deprecation/index.ts @@ -13,9 +13,12 @@ type DeprecationName = | "addTypename" | "canonizeResults" | "connectToDevTools" + | "getLastError" + | "getLastResult" | "graphql" | "observableQuery.result" | "parser" + | "resetLastResults" | "withQuery" | "withMutation" | "withSubscription" From 34b43517127b7bb65123ffad5939ef8048f575d2 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:55:53 -0600 Subject: [PATCH 31/48] Add deprecations for mock functions --- src/testing/core/mocking/mockClient.ts | 4 ++++ src/testing/core/mocking/mockLink.ts | 5 +++++ src/testing/core/mocking/mockSubscriptionLink.ts | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/testing/core/mocking/mockClient.ts b/src/testing/core/mocking/mockClient.ts index 3dad88bdf5d..c842bd86dac 100644 --- a/src/testing/core/mocking/mockClient.ts +++ b/src/testing/core/mocking/mockClient.ts @@ -5,6 +5,10 @@ import type { NormalizedCacheObject } from "../../../cache/index.js"; import { InMemoryCache } from "../../../cache/index.js"; import { mockSingleLink } from "./mockLink.js"; +/** + * @deprecated `createMockClient` will be removed in Apollo Client 4.0. Please + * instantiate a client using `new ApolloClient()` using a `MockLink`. + */ export function createMockClient( data: TData, query: DocumentNode, diff --git a/src/testing/core/mocking/mockLink.ts b/src/testing/core/mocking/mockLink.ts index 3b43caaa631..80dc0b493e1 100644 --- a/src/testing/core/mocking/mockLink.ts +++ b/src/testing/core/mocking/mockLink.ts @@ -296,6 +296,11 @@ export interface MockApolloLink extends ApolloLink { // Pass in multiple mocked responses, so that you can test flows that end up // making multiple queries to the server. // NOTE: The last arg can optionally be an `addTypename` arg. +/** + * @deprecated `mockSingleLink` will be removed in Apollo Client 4.0. Please + * initialize `MockLink` directly. Note that `addTypename` has been removed so + * please remove the final boolean argument if it is set. + */ export function mockSingleLink(...mockedResponses: Array): MockApolloLink { // To pull off the potential typename. If this isn't a boolean, we'll just // set it true later. diff --git a/src/testing/core/mocking/mockSubscriptionLink.ts b/src/testing/core/mocking/mockSubscriptionLink.ts index b91c86e8b68..99ac8407db8 100644 --- a/src/testing/core/mocking/mockSubscriptionLink.ts +++ b/src/testing/core/mocking/mockSubscriptionLink.ts @@ -63,6 +63,10 @@ export class MockSubscriptionLink extends ApolloLink { } } +/** + * @deprecated `mockObservableLink` will be removed in Apollo client 4.0. Please + * ininitialize `MockSubscriptionLink` directly. + */ export function mockObservableLink(): MockSubscriptionLink { return new MockSubscriptionLink(); } From f96e08b5bc2fdf70fd40ebf41740415d42f1bbf4 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:58:02 -0600 Subject: [PATCH 32/48] Add deprecation to result property in ServerError --- src/link/utils/throwServerError.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/link/utils/throwServerError.ts b/src/link/utils/throwServerError.ts index dfdb3adbf4d..d24c1c851d1 100644 --- a/src/link/utils/throwServerError.ts +++ b/src/link/utils/throwServerError.ts @@ -1,5 +1,18 @@ export type ServerError = Error & { response: Response; + /** + * @deprecated `result` will be removed in Apollo Client 4.0. + * + * **Recommended now** + * + * No action needed + * + * **When migrating** + * + * `result` has been replaced by `bodyText` which is the raw string body + * returned in the result. Use `JSON.parse` on the `bodyText` property to get + * the same value as `result`. + */ result: Record | string; statusCode: number; }; From efd6a2207b5e8e49c78d9018635b5481c66fed80 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 17:59:15 -0600 Subject: [PATCH 33/48] Add additional text --- src/react/internal/cache/QueryReference.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/react/internal/cache/QueryReference.ts b/src/react/internal/cache/QueryReference.ts index bc1bd3f5c59..9faa2f20bee 100644 --- a/src/react/internal/cache/QueryReference.ts +++ b/src/react/internal/cache/QueryReference.ts @@ -61,6 +61,7 @@ interface WrappedQueryRef /** * @deprecated Please use the `QueryRef` interface instead of `QueryReference`. + * `QueryReference` will be removed in Apollo Client 4.0. * * {@inheritDoc @apollo/client!QueryRef:interface} */ From 23f7564cd8f5a481de0fc67ee63334a0e0cd5283 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:03:16 -0600 Subject: [PATCH 34/48] Add deprecation to queryId --- src/core/ObservableQuery.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index fd541fabd90..d662d584dc6 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -83,6 +83,15 @@ export class ObservableQuery< private static inactiveOnCreation = new Slot(); public readonly options: WatchQueryOptions; + /** + * @deprecated `queryId` will be removed in Apollo Client 4.0. This value is + * safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * `ObservableQuery` does not have a unique identifier in 4.0. If you rely on + * this value, please try to migrate away from it. + */ public readonly queryId: string; public readonly queryName?: string; From 8e3aecdd7f57bed9d5e1ee5aca8c2bd89877cd0b Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:04:52 -0600 Subject: [PATCH 35/48] Add more text --- src/masking/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/masking/utils.ts b/src/masking/utils.ts index f815eadd2bb..c911b14a636 100644 --- a/src/masking/utils.ts +++ b/src/masking/utils.ts @@ -15,7 +15,7 @@ export function warnOnImproperCacheImplementation() { if (!issuedWarning) { issuedWarning = true; invariant.warn( - "The configured cache does not support data masking which effectively disables it. Please use a cache that supports data masking or disable data masking to silence this warning." + "The configured cache does not support data masking which effectively disables it. Please use a cache that supports data masking or disable data masking to silence this warning. Caches will be required to support the necessary data masking APIs in Apollo Client 4.0." ); } } From 5101dc0260dc5a5c8d21daddfccb23d36c625e8a Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:10:03 -0600 Subject: [PATCH 36/48] Deprecate incremental types --- src/link/core/types.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/link/core/types.ts b/src/link/core/types.ts index 22a83844a46..2fc54af1f13 100644 --- a/src/link/core/types.ts +++ b/src/link/core/types.ts @@ -5,12 +5,20 @@ export type { DocumentNode }; import type { Observable } from "../../utilities/index.js"; +/** + * @deprecated `ExecutionPatchResult` will be removed in Apollo Client 4.0. This + * type is safe to use in Apollo Client 3.x. + */ export type Path = ReadonlyArray; interface ExecutionPatchResultBase { hasNext?: boolean; } +/** + * @deprecated `ExecutionPatchResult` will be removed in Apollo Client 4.0. This + * type is safe to use in Apollo Client 3.x. + */ export interface ExecutionPatchInitialResult< TData = Record, TExtensions = Record, @@ -22,6 +30,10 @@ export interface ExecutionPatchInitialResult< extensions?: TExtensions; } +/** + * @deprecated `ExecutionPatchResult` will be removed in Apollo Client 4.0. This + * type is safe to use in Apollo Client 3.x. + */ export interface IncrementalPayload { // data and path must both be present // https://github.com/graphql/graphql-spec/pull/742/files#diff-98d0cd153b72b63c417ad4238e8cc0d3385691ccbde7f7674bc0d2a718b896ecR288-R293 @@ -32,6 +44,10 @@ export interface IncrementalPayload { extensions?: TExtensions; } +/** + * @deprecated `ExecutionPatchResult` will be removed in Apollo Client 4.0. This + * type is safe to use in Apollo Client 3.x. + */ export interface ExecutionPatchIncrementalResult< TData = Record, TExtensions = Record, @@ -59,6 +75,10 @@ export interface ApolloPayloadResult< errors?: ReadonlyArray; } +/** + * @deprecated `ExecutionPatchResult` will be removed in Apollo Client 4.0. This + * type is safe to use in Apollo Client 3.x. + */ export type ExecutionPatchResult< TData = Record, TExtensions = Record, From 4e87f496626297ea9aef33533e57e0558702a888 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:12:52 -0600 Subject: [PATCH 37/48] Deprecate response --- src/link/error/index.ts | 13 +++++++++++++ src/link/persisted-queries/index.ts | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/link/error/index.ts b/src/link/error/index.ts index b1b0aa6eeb3..0b3d325f1fe 100644 --- a/src/link/error/index.ts +++ b/src/link/error/index.ts @@ -61,6 +61,19 @@ export interface ErrorResponse { * read the error from the `error` property. */ protocolErrors?: ReadonlyArray; + + /** + * @deprecated `response` has renamed to `result` in Apollo Client 4.0. This + * property is safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When migrating** + * + * Use the `result` property instead of `response` inside your callback function. + */ response?: FormattedExecutionResult; operation: Operation; forward: NextLink; diff --git a/src/link/persisted-queries/index.ts b/src/link/persisted-queries/index.ts index 44095da1b63..af40ac227ff 100644 --- a/src/link/persisted-queries/index.ts +++ b/src/link/persisted-queries/index.ts @@ -27,6 +27,18 @@ export const VERSION = 1; export interface ErrorResponse { graphQLErrors?: ReadonlyArray; networkError?: NetworkError; + /** + * @deprecated `response` has renamed to `result` in Apollo Client 4.0. This + * property is safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When migrating** + * + * Use the `result` property instead of `response` inside your callback function. + */ response?: FormattedExecutionResult; operation: Operation; meta: ErrorMeta; From c1e248ccdae7b9d6498f1b2c9283781b4c9129f9 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:13:50 -0600 Subject: [PATCH 38/48] Add deprecations for error properties in persisted-queries link --- src/link/persisted-queries/index.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/link/persisted-queries/index.ts b/src/link/persisted-queries/index.ts index af40ac227ff..8c126f0911c 100644 --- a/src/link/persisted-queries/index.ts +++ b/src/link/persisted-queries/index.ts @@ -25,7 +25,33 @@ import { export const VERSION = 1; export interface ErrorResponse { + /** + * @deprecated `graphQLErrors` will no longer available in options in Apollo Client 4.0. + * This value is safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When upgrading** + * + * `graphQLErrors` has been consolidated to the `error` property. You will need to + * read the error from the `error` property. + */ graphQLErrors?: ReadonlyArray; + /** + * @deprecated `networkError` will no longer available in options in Apollo Client 4.0. + * This value is safe to use in Apollo Client 3.x. + * + * **Recommended now** + * + * No action needed + * + * **When upgrading** + * + * `networkError` has been consolidated to the `error` property. You will need to + * read the error from the `error` property. + */ networkError?: NetworkError; /** * @deprecated `response` has renamed to `result` in Apollo Client 4.0. This From 56547bcc1cd807d02e0a7f0510e6ec35454cc4a4 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:16:26 -0600 Subject: [PATCH 39/48] Fix typo --- src/errors/index.ts | 4 ++-- src/testing/core/mocking/mockLink.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/errors/index.ts b/src/errors/index.ts index da943c855ea..e68e3875839 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -53,13 +53,13 @@ export function graphQLResultHasProtocolErrors( * **When migrating** * * Errors are no longer wrapped in Apollo Client 4.0. To check if an error is an - * instance of an error provided by Apollo Client, use the static `.is` methods + * instance of an error provided by Apollo Client, use the static `.is` method * on the error class you want to test against. * * ```ts * // Test if an error is an instance of `CombinedGraphQLErrors` * const isGraphQLErrors = CombinedGraphQLErrors.is(error); - * ```` + * ``` */ export function isApolloError(err: Error): err is ApolloError { return err.hasOwnProperty("graphQLErrors"); diff --git a/src/testing/core/mocking/mockLink.ts b/src/testing/core/mocking/mockLink.ts index 80dc0b493e1..892437f75ec 100644 --- a/src/testing/core/mocking/mockLink.ts +++ b/src/testing/core/mocking/mockLink.ts @@ -54,7 +54,6 @@ export interface MockedResponse< * @deprecated `newData` will be removed in Apollo Client 4.0. Please use the * `result` option with a callback function instead and provide a * `maxUsageCount` of `Number.POSITIVE_INFINITY` to get the same behavior. - * ``` */ newData?: ResultFunction>, TVariables>; } From 4adf1248f381be5bc0901c792a336423daaaed02 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:18:59 -0600 Subject: [PATCH 40/48] Update api report --- .api-reports/api-report-core.api.md | 56 ++++++++-------- .api-reports/api-report-errors.api.md | 12 ++-- .../api-report-link_batch-http.api.md | 14 ++-- .api-reports/api-report-link_batch.api.md | 14 ++-- .api-reports/api-report-link_context.api.md | 14 ++-- .api-reports/api-report-link_core.api.md | 14 ++-- .api-reports/api-report-link_error.api.md | 20 +++--- .api-reports/api-report-link_http.api.md | 14 ++-- .../api-report-link_persisted-queries.api.md | 20 +++--- .../api-report-link_remove-typename.api.md | 14 ++-- .api-reports/api-report-link_retry.api.md | 14 ++-- .api-reports/api-report-link_schema.api.md | 14 ++-- .../api-report-link_subscriptions.api.md | 14 ++-- .api-reports/api-report-link_utils.api.md | 8 +-- .api-reports/api-report-link_ws.api.md | 14 ++-- .api-reports/api-report-react.api.md | 60 ++++++++--------- .../api-report-react_components.api.md | 61 ++++++++--------- .api-reports/api-report-react_context.api.md | 57 ++++++++-------- .api-reports/api-report-react_hoc.api.md | 55 ++++++++-------- .api-reports/api-report-react_hooks.api.md | 60 ++++++++--------- .api-reports/api-report-react_internal.api.md | 56 ++++++++-------- .api-reports/api-report-react_ssr.api.md | 57 ++++++++-------- .api-reports/api-report-testing.api.md | 63 +++++++++--------- .api-reports/api-report-testing_core.api.md | 63 +++++++++--------- .api-reports/api-report-utilities.api.md | 55 ++++++++-------- ...report-utilities_subscriptions_urql.api.md | 2 +- .api-reports/api-report.api.md | 66 +++++++++---------- 27 files changed, 461 insertions(+), 450 deletions(-) diff --git a/.api-reports/api-report-core.api.md b/.api-reports/api-report-core.api.md index d62d4986971..c7702aea9e8 100644 --- a/.api-reports/api-report-core.api.md +++ b/.api-reports/api-report-core.api.md @@ -93,7 +93,7 @@ export abstract class ApolloCache implements DataProxy { } // @public -export class ApolloClient implements DataProxy { +export class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -137,9 +137,9 @@ export class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - resetStore(): Promise[] | null>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // @deprecated @@ -255,13 +255,13 @@ export class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // (undocumented) request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // (undocumented) static split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink; @@ -811,7 +811,7 @@ export const execute: typeof ApolloLink.execute; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) export interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -823,7 +823,7 @@ export interface ExecutionPatchIncrementalResult, TE incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) export interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -835,7 +835,7 @@ export interface ExecutionPatchInitialResult, TExten incremental?: never; } -// @public (undocumented) +// @public @deprecated (undocumented) export type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -993,10 +993,10 @@ TData // @public (undocumented) export const from: typeof ApolloLink.from; -// @public (undocumented) +// @public @deprecated (undocumented) export function fromError(errorValue: any): Observable; -// @public (undocumented) +// @public @deprecated (undocumented) export function fromPromise(promise: Promise): Observable; // @internal @@ -1142,7 +1142,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) export interface IncrementalPayload { // (undocumented) data: TData | null; @@ -1253,7 +1253,7 @@ export interface InternalRefetchQueriesOptions, } // @public (undocumented) -export type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +export type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // @public (undocumented) export type InternalRefetchQueryDescriptor = RefetchQueryDescriptor | QueryOptions; @@ -1335,7 +1335,7 @@ const _invalidateModifier: unique symbol; // @public (undocumented) type IsAny = 0 extends 1 & T ? true : false; -// @public (undocumented) +// @public @deprecated (undocumented) export function isApolloError(err: Error): err is ApolloError; // @public @@ -1646,7 +1646,7 @@ export type MutationQueryReducersMap = ApolloCache> extends MutationBaseOptions { fetchPolicy?: MutationFetchPolicy; keepRootFields?: boolean; @@ -1767,9 +1767,9 @@ export class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1781,7 +1781,7 @@ export class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1794,21 +1794,21 @@ export class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): ObservableSubscription; // (undocumented) resubscribeAfterError(observer: Observer>): ObservableSubscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1862,7 +1862,7 @@ type OptionsUnion = Watc // @public (undocumented) export function parseAndCheckHttpResponse(operations: Operation | Operation[]): (response: Response) => Promise; -// @public (undocumented) +// @public @deprecated (undocumented) export type Path = ReadonlyArray; // @public (undocumented) @@ -2230,7 +2230,7 @@ export interface RefetchQueriesOptions, TResult> // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +export type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // @public (undocumented) export interface RefetchQueriesResult extends Promise> { @@ -2439,10 +2439,10 @@ export interface SubscriptionOptions = unionToIntersection 0 : never> extends ((x: infer U) => 0) ? U : never; -// @public (undocumented) +// @public @deprecated (undocumented) export const throwServerError: (response: Response, result: any, message: string) => never; -// @public (undocumented) +// @public @deprecated (undocumented) export function toPromise(observable: Observable): Promise; // @public (undocumented) @@ -2611,8 +2611,8 @@ interface WriteContext extends ReadMergeModifyContext { // src/cache/inmemory/policies.ts:162:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts // src/cache/inmemory/policies.ts:162:3 - (ae-forgotten-export) The symbol "KeyArgsFunction" needs to be exported by the entry point index.d.ts // src/cache/inmemory/types.ts:139:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:130:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:131:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:143:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:144:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:160:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:415:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report-errors.api.md b/.api-reports/api-report-errors.api.md index b388b1263dc..245b71b1db6 100644 --- a/.api-reports/api-report-errors.api.md +++ b/.api-reports/api-report-errors.api.md @@ -56,7 +56,7 @@ interface DefaultContext extends Record { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -70,7 +70,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -85,7 +85,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -115,7 +115,7 @@ export type GraphQLErrors = ReadonlyArray; // @public (undocumented) export function graphQLResultHasProtocolErrors(result: FetchResult): result is FetchResultWithSymbolExtensions; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -131,13 +131,13 @@ interface IncrementalPayload { path: Path; } -// @public (undocumented) +// @public @deprecated (undocumented) export function isApolloError(err: Error): err is ApolloError; // @public (undocumented) export type NetworkError = Error | ServerParseError | ServerError | null; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_batch-http.api.md b/.api-reports/api-report-link_batch-http.api.md index f212ce55c05..9352ba6515e 100644 --- a/.api-reports/api-report-link_batch-http.api.md +++ b/.api-reports/api-report-link_batch-http.api.md @@ -32,7 +32,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -40,7 +40,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -97,7 +97,7 @@ interface DefaultContext extends Record { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -111,7 +111,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -126,7 +126,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -173,7 +173,7 @@ interface HttpOptions { useGETForQueries?: boolean; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -211,7 +211,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_batch.api.md b/.api-reports/api-report-link_batch.api.md index f7e4426ef61..847e0de4475 100644 --- a/.api-reports/api-report-link_batch.api.md +++ b/.api-reports/api-report-link_batch.api.md @@ -31,7 +31,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -39,7 +39,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -87,7 +87,7 @@ interface DefaultContext extends Record { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -101,7 +101,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -116,7 +116,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -147,7 +147,7 @@ interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -200,7 +200,7 @@ export class OperationBatcher { enqueueRequest(request: BatchableRequest): Observable; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_context.api.md b/.api-reports/api-report-link_context.api.md index cbf51621b32..3b8fb51287e 100644 --- a/.api-reports/api-report-link_context.api.md +++ b/.api-reports/api-report-link_context.api.md @@ -31,7 +31,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -39,7 +39,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -60,7 +60,7 @@ interface DefaultContext extends Record { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -74,7 +74,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -89,7 +89,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -118,7 +118,7 @@ interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -156,7 +156,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_core.api.md b/.api-reports/api-report-link_core.api.md index 173736f0ee9..eec35723989 100644 --- a/.api-reports/api-report-link_core.api.md +++ b/.api-reports/api-report-link_core.api.md @@ -26,13 +26,13 @@ export class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // (undocumented) request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // (undocumented) static split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink; @@ -67,7 +67,7 @@ export const execute: typeof ApolloLink.execute; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) export interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -79,7 +79,7 @@ export interface ExecutionPatchIncrementalResult, TE incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) export interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -91,7 +91,7 @@ export interface ExecutionPatchInitialResult, TExten incremental?: never; } -// @public (undocumented) +// @public @deprecated (undocumented) export type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -120,7 +120,7 @@ export interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) export interface IncrementalPayload { // (undocumented) data: TData | null; @@ -156,7 +156,7 @@ export interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) export type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_error.api.md b/.api-reports/api-report-link_error.api.md index 5b1fb7b3ebf..eed0c7e295c 100644 --- a/.api-reports/api-report-link_error.api.md +++ b/.api-reports/api-report-link_error.api.md @@ -32,7 +32,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -40,7 +40,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -80,19 +80,23 @@ export class ErrorLink extends ApolloLink { export interface ErrorResponse { // (undocumented) forward: NextLink; + // @deprecated graphQLErrors?: ReadonlyArray; // Warning: (ae-forgotten-export) The symbol "NetworkError" needs to be exported by the entry point index.d.ts + // + // @deprecated networkError?: NetworkError; // (undocumented) operation: Operation; + // @deprecated protocolErrors?: ReadonlyArray; - // (undocumented) + // @deprecated (undocumented) response?: FormattedExecutionResult; } // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -106,7 +110,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -121,7 +125,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -152,7 +156,7 @@ interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -199,7 +203,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_http.api.md b/.api-reports/api-report-link_http.api.md index dd7cf6778c2..62ec3e2d6ab 100644 --- a/.api-reports/api-report-link_http.api.md +++ b/.api-reports/api-report-link_http.api.md @@ -33,7 +33,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -41,7 +41,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -96,7 +96,7 @@ export const defaultPrinter: Printer; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -110,7 +110,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -125,7 +125,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -211,7 +211,7 @@ interface HttpQueryOptions { preserveHeaderCase?: boolean; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -252,7 +252,7 @@ interface Operation { // @public (undocumented) export function parseAndCheckHttpResponse(operations: Operation | Operation[]): (response: Response) => Promise; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_persisted-queries.api.md b/.api-reports/api-report-link_persisted-queries.api.md index d6da2bba7b1..90f31cf3f46 100644 --- a/.api-reports/api-report-link_persisted-queries.api.md +++ b/.api-reports/api-report-link_persisted-queries.api.md @@ -32,7 +32,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -40,7 +40,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -87,7 +87,7 @@ type ErrorMeta = { // @public (undocumented) export interface ErrorResponse { - // (undocumented) + // @deprecated (undocumented) graphQLErrors?: ReadonlyArray; // Warning: (ae-forgotten-export) The symbol "ErrorMeta" needs to be exported by the entry point index.d.ts // @@ -95,17 +95,17 @@ export interface ErrorResponse { meta: ErrorMeta; // Warning: (ae-forgotten-export) The symbol "NetworkError" needs to be exported by the entry point index.d.ts // - // (undocumented) + // @deprecated (undocumented) networkError?: NetworkError; // (undocumented) operation: Operation; - // (undocumented) + // @deprecated (undocumented) response?: FormattedExecutionResult; } // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -119,7 +119,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -134,7 +134,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -168,7 +168,7 @@ interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -212,7 +212,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_remove-typename.api.md b/.api-reports/api-report-link_remove-typename.api.md index 7d088615a2b..8bcf62cafa9 100644 --- a/.api-reports/api-report-link_remove-typename.api.md +++ b/.api-reports/api-report-link_remove-typename.api.md @@ -31,7 +31,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -39,7 +39,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -55,7 +55,7 @@ interface DefaultContext extends Record { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -69,7 +69,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -84,7 +84,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -115,7 +115,7 @@ interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -162,7 +162,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // Warning: (ae-forgotten-export) The symbol "ApolloLink" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report-link_retry.api.md b/.api-reports/api-report-link_retry.api.md index 843ff5f1654..50d19738dbf 100644 --- a/.api-reports/api-report-link_retry.api.md +++ b/.api-reports/api-report-link_retry.api.md @@ -31,7 +31,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -39,7 +39,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -68,7 +68,7 @@ interface DelayFunctionOptions { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -82,7 +82,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -97,7 +97,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -128,7 +128,7 @@ interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -166,7 +166,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_schema.api.md b/.api-reports/api-report-link_schema.api.md index 817398b7594..4bfa65619ca 100644 --- a/.api-reports/api-report-link_schema.api.md +++ b/.api-reports/api-report-link_schema.api.md @@ -32,7 +32,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -40,7 +40,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -56,7 +56,7 @@ interface DefaultContext extends Record { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -70,7 +70,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -85,7 +85,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -116,7 +116,7 @@ interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -154,7 +154,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_subscriptions.api.md b/.api-reports/api-report-link_subscriptions.api.md index b7fcb443f86..7795e357967 100644 --- a/.api-reports/api-report-link_subscriptions.api.md +++ b/.api-reports/api-report-link_subscriptions.api.md @@ -32,7 +32,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -40,7 +40,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -56,7 +56,7 @@ interface DefaultContext extends Record { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -70,7 +70,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -85,7 +85,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -127,7 +127,7 @@ export class GraphQLWsLink extends ApolloLink { request(operation: Operation): Observable; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -165,7 +165,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-link_utils.api.md b/.api-reports/api-report-link_utils.api.md index edce7cda76d..285de36eb1b 100644 --- a/.api-reports/api-report-link_utils.api.md +++ b/.api-reports/api-report-link_utils.api.md @@ -22,10 +22,10 @@ export function filterOperationVariables(variables: Record, query: [x: string]: any; }; -// @public (undocumented) +// @public @deprecated (undocumented) export function fromError(errorValue: any): Observable; -// @public (undocumented) +// @public @deprecated (undocumented) export function fromPromise(promise: Promise): Observable; // @public (undocumented) @@ -70,10 +70,10 @@ export type ServerError = Error & { statusCode: number; }; -// @public (undocumented) +// @public @deprecated (undocumented) export const throwServerError: (response: Response, result: any, message: string) => never; -// @public (undocumented) +// @public @deprecated (undocumented) export function toPromise(observable: Observable): Promise; // @public (undocumented) diff --git a/.api-reports/api-report-link_ws.api.md b/.api-reports/api-report-link_ws.api.md index ec666d00c71..0b067ab255c 100644 --- a/.api-reports/api-report-link_ws.api.md +++ b/.api-reports/api-report-link_ws.api.md @@ -33,7 +33,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -41,7 +41,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -57,7 +57,7 @@ interface DefaultContext extends Record { // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -71,7 +71,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -86,7 +86,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -117,7 +117,7 @@ interface GraphQLRequest> { variables?: TVariables; } -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -155,7 +155,7 @@ interface Operation { variables: Record; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) diff --git a/.api-reports/api-report-react.api.md b/.api-reports/api-report-react.api.md index 7931cbac607..092ebdbb144 100644 --- a/.api-reports/api-report-react.api.md +++ b/.api-reports/api-report-react.api.md @@ -101,7 +101,7 @@ abstract class ApolloCache implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -160,12 +160,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -321,7 +320,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -329,7 +328,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -395,7 +394,7 @@ type BackgroundQueryHookOptionsNoInfer = ApolloCache> extends MutationSharedOptions { client?: ApolloClient; // @deprecated @@ -407,14 +406,14 @@ export interface BaseMutationOptions extends SharedWatchQueryOptions { client?: ApolloClient; context?: Context; ssr?: boolean; } -// @public (undocumented) +// @public @deprecated (undocumented) export interface BaseSubscriptionOptions { client?: ApolloClient; context?: Context; @@ -805,7 +804,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -819,7 +818,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -834,7 +833,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -851,6 +850,7 @@ type ExtractByMatchingTypeNames = (fetchMoreOptions: FetchMoreQueryOptions & { @@ -994,7 +994,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -1032,7 +1032,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -1461,7 +1461,7 @@ export interface MutationResult { // Warning: (ae-forgotten-export) The symbol "MutationBaseOptions" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface MutationSharedOptions = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1540,9 +1540,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1554,7 +1554,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1567,21 +1567,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1594,7 +1594,7 @@ class ObservableQuery { fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & { updateQuery?: (previousQueryResult: Unmasked, options: { @@ -1670,7 +1670,7 @@ export namespace parser { resetCache: () => void; } -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public @@ -1746,7 +1746,7 @@ export interface QueryDataOptions; } -// @public (undocumented) +// @public @deprecated (undocumented) export interface QueryFunctionOptions extends BaseQueryOptions { // @internal (undocumented) defaultOptions?: Partial>; @@ -2086,7 +2086,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -2730,13 +2730,13 @@ interface WatchQueryOptions implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -161,12 +161,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -299,7 +298,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -307,7 +306,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -342,7 +341,7 @@ type AsStoreObject = ApolloCache> extends MutationSharedOptions { // Warning: (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts client?: ApolloClient; @@ -355,14 +354,14 @@ interface BaseMutationOptions extends SharedWatchQueryOptions { client?: ApolloClient; context?: DefaultContext; ssr?: boolean; } -// @public (undocumented) +// @public @deprecated (undocumented) interface BaseSubscriptionOptions { client?: ApolloClient; context?: DefaultContext; @@ -737,7 +736,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -751,7 +750,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -766,7 +765,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -898,7 +897,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -936,7 +935,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -1285,7 +1284,7 @@ interface MutationResult { // Warning: (ae-forgotten-export) The symbol "MutationBaseOptions" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface MutationSharedOptions = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1342,6 +1341,8 @@ type NextResultListener = (method: "next" | "error" | "complete", arg?: any) => // @public type NoInfer_2 = [T][T extends any ? 0 : never]; +// Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts +// // @public (undocumented) class ObservableQuery extends Observable>> { constructor({ queryManager, queryInfo, options, }: { @@ -1358,9 +1359,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1372,7 +1373,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1385,21 +1386,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription_2; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription_2; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1413,7 +1414,7 @@ class ObservableQuery { fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & { updateQuery?: (previousQueryResult: Unmasked, options: { @@ -1475,7 +1476,7 @@ interface Operation { // @public (undocumented) type OperationVariables = Record; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) @@ -1515,7 +1516,7 @@ export interface QueryComponentOptions extends BaseQueryOptions { // @internal (undocumented) defaultOptions?: Partial>; @@ -1809,7 +1810,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -2126,13 +2127,13 @@ interface WatchQueryOptions implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -160,12 +160,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -319,7 +318,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -327,7 +326,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -373,7 +372,7 @@ type AsStoreObject extends SharedWatchQueryOptions { client?: ApolloClient; context?: DefaultContext; @@ -730,7 +729,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -744,7 +743,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -759,7 +758,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -894,7 +893,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -932,7 +931,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -1238,7 +1237,7 @@ type MutationQueryReducersMap = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1295,6 +1294,8 @@ type NextResultListener = (method: "next" | "error" | "complete", arg?: any) => // @public type NoInfer_2 = [T][T extends any ? 0 : never]; +// Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts +// // @public (undocumented) class ObservableQuery extends Observable>> { constructor({ queryManager, queryInfo, options, }: { @@ -1311,9 +1312,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1325,7 +1326,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1338,21 +1339,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1366,7 +1367,7 @@ class ObservableQuery { fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & { updateQuery?: (previousQueryResult: Unmasked, options: { @@ -1410,7 +1411,7 @@ interface Operation { // @public (undocumented) type OperationVariables = Record; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) @@ -1442,7 +1443,7 @@ interface QueryDataOptions extends BaseQueryOptions { // @internal (undocumented) defaultOptions?: Partial>; @@ -1736,7 +1737,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -2045,13 +2046,13 @@ interface WatchQueryOptions implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -160,12 +160,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -298,7 +297,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -306,7 +305,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -341,7 +340,7 @@ type AsStoreObject = ApolloCache> extends MutationSharedOptions { // Warning: (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts client?: ApolloClient; @@ -354,7 +353,7 @@ interface BaseMutationOptions extends SharedWatchQueryOptions { client?: ApolloClient; context?: DefaultContext; @@ -729,7 +728,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -743,7 +742,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -758,7 +757,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -902,7 +901,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -940,7 +939,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -1278,7 +1277,7 @@ interface MutationResult { // Warning: (ae-forgotten-export) The symbol "MutationBaseOptions" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface MutationSharedOptions = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1335,6 +1334,8 @@ type NextResultListener = (method: "next" | "error" | "complete", arg?: any) => // @public type NoInfer_2 = [T][T extends any ? 0 : never]; +// Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts +// // @public (undocumented) class ObservableQuery extends Observable>> { constructor({ queryManager, queryInfo, options, }: { @@ -1351,9 +1352,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1365,7 +1366,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1378,21 +1379,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1457,7 +1458,7 @@ export interface OptionProps; // @public (undocumented) @@ -1761,7 +1762,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -2056,13 +2057,13 @@ export function withSubscription implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -159,12 +159,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -297,7 +296,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -305,7 +304,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -365,7 +364,7 @@ type BackgroundQueryHookOptionsNoInfer = ApolloCache> extends MutationSharedOptions { // Warning: (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts client?: ApolloClient; @@ -378,14 +377,14 @@ interface BaseMutationOptions extends SharedWatchQueryOptions { client?: ApolloClient; context?: DefaultContext; ssr?: boolean; } -// @public (undocumented) +// @public @deprecated (undocumented) interface BaseSubscriptionOptions { client?: ApolloClient; context?: DefaultContext; @@ -760,7 +759,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -774,7 +773,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -789,7 +788,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -806,6 +805,7 @@ type ExtractByMatchingTypeNames = (fetchMoreOptions: FetchMoreQueryOptions & { @@ -936,7 +936,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -974,7 +974,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -1405,7 +1405,7 @@ interface MutationResult { // Warning: (ae-forgotten-export) The symbol "MutationBaseOptions" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface MutationSharedOptions = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1486,9 +1486,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1500,7 +1500,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1513,21 +1513,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1540,7 +1540,7 @@ class ObservableQuery { fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & { updateQuery?: (previousQueryResult: Unmasked, options: { @@ -1606,7 +1606,7 @@ interface Operation { // @public (undocumented) type OperationVariables = Record; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) @@ -1620,7 +1620,7 @@ type Primitive = null | undefined | string | number | boolean | symbol | bigint; // @public (undocumented) const QUERY_REF_BRAND: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface QueryFunctionOptions extends BaseQueryOptions { // @internal (undocumented) defaultOptions?: Partial>; @@ -1946,7 +1946,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -2570,13 +2570,13 @@ interface WatchQueryOptions implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -159,12 +159,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -297,7 +296,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -305,7 +304,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -373,7 +372,7 @@ type BackgroundQueryHookOptionsNoInfer extends SharedWatchQueryOptions { // Warning: (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts client?: ApolloClient; @@ -743,7 +742,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -757,7 +756,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -772,7 +771,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -789,6 +788,7 @@ type ExtractByMatchingTypeNames = (fetchMoreOptions: FetchMoreQueryOptions & { @@ -999,7 +999,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -1085,7 +1085,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -1402,7 +1402,7 @@ type MutationQueryReducersMap = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1474,9 +1474,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1488,7 +1488,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1501,21 +1501,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1529,7 +1529,7 @@ class ObservableQuery { fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & { updateQuery?: (previousQueryResult: Unmasked, options: { @@ -1586,7 +1586,7 @@ interface Operation { // @public (undocumented) type OperationVariables = Record; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) @@ -1673,7 +1673,7 @@ const QUERY_REFERENCE_SYMBOL: unique symbol; // Warning: (ae-forgotten-export) The symbol "BaseQueryOptions" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface QueryFunctionOptions extends BaseQueryOptions { // @internal (undocumented) defaultOptions?: Partial>; @@ -1997,7 +1997,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -2638,13 +2638,13 @@ export function wrapQueryRef(inter // src/cache/core/types/common.ts:104:3 - (ae-forgotten-export) The symbol "ToReferenceFunction" needs to be exported by the entry point index.d.ts // src/cache/core/types/common.ts:105:3 - (ae-forgotten-export) The symbol "StorageType" needs to be exported by the entry point index.d.ts // src/core/LocalState.ts:46:5 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:130:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:131:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:143:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:144:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:160:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:415:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/types.ts:396:2 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts // src/core/types.ts:396:2 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:357:2 - (ae-forgotten-export) The symbol "UpdateQueryOptions" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:366:2 - (ae-forgotten-export) The symbol "UpdateQueryOptions" needs to be exported by the entry point index.d.ts // src/react/hooks/useBackgroundQuery.ts:52:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts // src/react/hooks/useBackgroundQuery.ts:76:4 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts // src/react/hooks/useSuspenseFragment.ts:70:5 - (ae-forgotten-export) The symbol "From" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report-react_ssr.api.md b/.api-reports/api-report-react_ssr.api.md index 93f2f9c0296..255b498bea7 100644 --- a/.api-reports/api-report-react_ssr.api.md +++ b/.api-reports/api-report-react_ssr.api.md @@ -100,7 +100,7 @@ abstract class ApolloCache implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -160,12 +160,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -298,7 +297,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -306,7 +305,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -341,7 +340,7 @@ type AsStoreObject extends SharedWatchQueryOptions { // Warning: (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts client?: ApolloClient; @@ -699,7 +698,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -713,7 +712,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -728,7 +727,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -879,7 +878,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -917,7 +916,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -1223,7 +1222,7 @@ type MutationQueryReducersMap = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1280,6 +1279,8 @@ type NextResultListener = (method: "next" | "error" | "complete", arg?: any) => // @public type NoInfer_2 = [T][T extends any ? 0 : never]; +// Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts +// // @public (undocumented) class ObservableQuery extends Observable>> { constructor({ queryManager, queryInfo, options, }: { @@ -1296,9 +1297,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1310,7 +1311,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1323,21 +1324,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1351,7 +1352,7 @@ class ObservableQuery { fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & { updateQuery?: (previousQueryResult: Unmasked, options: { @@ -1395,7 +1396,7 @@ interface Operation { // @public (undocumented) type OperationVariables = Record; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) @@ -1427,7 +1428,7 @@ interface QueryDataOptions extends BaseQueryOptions { // @internal (undocumented) defaultOptions?: Partial>; @@ -1721,7 +1722,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -2030,13 +2031,13 @@ interface WatchQueryOptions implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -160,12 +160,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -298,7 +297,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -306,7 +305,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -510,7 +509,7 @@ type CovariantUnaryFunction = { // Warning: (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "NormalizedCacheObject" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) export function createMockClient(data: TData, query: DocumentNode, variables?: {}): ApolloClient; // @public (undocumented) @@ -700,7 +699,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -714,7 +713,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -729,7 +728,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -861,7 +860,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -899,7 +898,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -996,7 +995,7 @@ function isReference(obj: any): obj is Reference; // @public (undocumented) type IsStrictlyAny = UnionToIntersection> extends never ? true : false; -// @public (undocumented) +// @public @deprecated (undocumented) export const itAsync: ((this: unknown, message: string, callback: (resolve: (result?: any) => void, reject: (reason?: any) => void) => any, timeout?: number | undefined) => void) & { only: (message: string, callback: (resolve: (result?: any) => void, reject: (reason?: any) => void) => any, timeout?: number) => void; skip: (message: string, callback: (resolve: (result?: any) => void, reject: (reason?: any) => void) => any, timeout?: number) => void; @@ -1196,7 +1195,7 @@ export interface MockedResponse, out TVariables error?: Error; // (undocumented) maxUsageCount?: number; - // (undocumented) + // @deprecated (undocumented) newData?: ResultFunction>, TVariables>; // (undocumented) request: GraphQLRequest; @@ -1239,12 +1238,12 @@ export interface MockLinkOptions { showWarnings?: boolean; } -// @public (undocumented) +// @public @deprecated (undocumented) export function mockObservableLink(): MockSubscriptionLink; // Warning: (ae-forgotten-export) The symbol "MockApolloLink" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) export function mockSingleLink(...mockedResponses: Array): MockApolloLink; // @public (undocumented) @@ -1344,7 +1343,7 @@ type MutationQueryReducersMap = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1411,6 +1410,8 @@ interface NormalizedCacheObject { }; } +// Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts +// // @public (undocumented) class ObservableQuery extends Observable>> { constructor({ queryManager, queryInfo, options, }: { @@ -1427,9 +1428,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1441,7 +1442,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1454,21 +1455,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1507,7 +1508,7 @@ interface Operation { // @public (undocumented) type OperationVariables = Record; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) @@ -1783,7 +1784,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -1908,7 +1909,7 @@ Item // @public (undocumented) type StoreValue = number | string | string[] | Reference | Reference[] | null | undefined | void | Object; -// @public (undocumented) +// @public @deprecated (undocumented) export function subscribeAndCount(reject: (reason: any) => any, observable: Observable, cb: (handleCount: number, result: TResult) => any): Subscription; // @public (undocumented) @@ -2089,13 +2090,13 @@ export function withWarningSpy(it: (...args: TArgs // src/cache/core/types/common.ts:104:3 - (ae-forgotten-export) The symbol "ToReferenceFunction" needs to be exported by the entry point index.d.ts // src/cache/core/types/common.ts:105:3 - (ae-forgotten-export) The symbol "StorageType" needs to be exported by the entry point index.d.ts // src/core/LocalState.ts:46:5 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:130:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:131:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:143:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:144:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:160:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:415:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/types.ts:396:2 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts // src/core/types.ts:396:2 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:357:2 - (ae-forgotten-export) The symbol "UpdateQueryOptions" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:366:2 - (ae-forgotten-export) The symbol "UpdateQueryOptions" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/.api-reports/api-report-testing_core.api.md b/.api-reports/api-report-testing_core.api.md index 759db2bec53..c2ef06afe8b 100644 --- a/.api-reports/api-report-testing_core.api.md +++ b/.api-reports/api-report-testing_core.api.md @@ -99,7 +99,7 @@ abstract class ApolloCache implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -159,12 +159,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -297,7 +296,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -305,7 +304,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -509,7 +508,7 @@ type CovariantUnaryFunction = { // Warning: (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "NormalizedCacheObject" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) export function createMockClient(data: TData, query: DocumentNode, variables?: {}): ApolloClient; // @public (undocumented) @@ -699,7 +698,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -713,7 +712,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -728,7 +727,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -860,7 +859,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -898,7 +897,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -995,7 +994,7 @@ function isReference(obj: any): obj is Reference; // @public (undocumented) type IsStrictlyAny = UnionToIntersection> extends never ? true : false; -// @public (undocumented) +// @public @deprecated (undocumented) export const itAsync: ((this: unknown, message: string, callback: (resolve: (result?: any) => void, reject: (reason?: any) => void) => any, timeout?: number | undefined) => void) & { only: (message: string, callback: (resolve: (result?: any) => void, reject: (reason?: any) => void) => any, timeout?: number) => void; skip: (message: string, callback: (resolve: (result?: any) => void, reject: (reason?: any) => void) => any, timeout?: number) => void; @@ -1151,7 +1150,7 @@ export interface MockedResponse, out TVariables error?: Error; // (undocumented) maxUsageCount?: number; - // (undocumented) + // @deprecated (undocumented) newData?: ResultFunction>, TVariables>; // (undocumented) request: GraphQLRequest; @@ -1194,12 +1193,12 @@ export interface MockLinkOptions { showWarnings?: boolean; } -// @public (undocumented) +// @public @deprecated (undocumented) export function mockObservableLink(): MockSubscriptionLink; // Warning: (ae-forgotten-export) The symbol "MockApolloLink" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) export function mockSingleLink(...mockedResponses: Array): MockApolloLink; // @public (undocumented) @@ -1299,7 +1298,7 @@ type MutationQueryReducersMap = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -1366,6 +1365,8 @@ interface NormalizedCacheObject { }; } +// Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts +// // @public (undocumented) class ObservableQuery extends Observable>> { constructor({ queryManager, queryInfo, options, }: { @@ -1382,9 +1383,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -1396,7 +1397,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -1409,21 +1410,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): Subscription; // (undocumented) resubscribeAfterError(observer: Observer>): Subscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -1462,7 +1463,7 @@ interface Operation { // @public (undocumented) type OperationVariables = Record; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) @@ -1740,7 +1741,7 @@ interface RefetchQueriesOptions, TResult> { // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -1865,7 +1866,7 @@ Item // @public (undocumented) type StoreValue = number | string | string[] | Reference | Reference[] | null | undefined | void | Object; -// @public (undocumented) +// @public @deprecated (undocumented) export function subscribeAndCount(reject: (reason: any) => any, observable: Observable, cb: (handleCount: number, result: TResult) => any): Subscription; // @public (undocumented) @@ -2046,13 +2047,13 @@ export function withWarningSpy(it: (...args: TArgs // src/cache/core/types/common.ts:104:3 - (ae-forgotten-export) The symbol "ToReferenceFunction" needs to be exported by the entry point index.d.ts // src/cache/core/types/common.ts:105:3 - (ae-forgotten-export) The symbol "StorageType" needs to be exported by the entry point index.d.ts // src/core/LocalState.ts:46:5 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:130:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:131:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:143:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:144:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:160:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:415:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/types.ts:396:2 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts // src/core/types.ts:396:2 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:357:2 - (ae-forgotten-export) The symbol "UpdateQueryOptions" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:366:2 - (ae-forgotten-export) The symbol "UpdateQueryOptions" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/.api-reports/api-report-utilities.api.md b/.api-reports/api-report-utilities.api.md index f1a29381495..dc38b91aacd 100644 --- a/.api-reports/api-report-utilities.api.md +++ b/.api-reports/api-report-utilities.api.md @@ -115,7 +115,7 @@ abstract class ApolloCache implements DataProxy { } // @public -class ApolloClient implements DataProxy { +class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -174,12 +174,11 @@ class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "RefetchQueriesResult" needs to be exported by the entry point index.d.ts - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - // Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts - resetStore(): Promise[] | null>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // Warning: (ae-forgotten-export) The symbol "FragmentMatcher" needs to be exported by the entry point index.d.ts @@ -312,7 +311,7 @@ class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // Warning: (ae-forgotten-export) The symbol "NextLink" needs to be exported by the entry point index.d.ts // @@ -320,7 +319,7 @@ class ApolloLink { request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // Warning: (ae-forgotten-export) The symbol "Operation" needs to be exported by the entry point index.d.ts // @@ -373,7 +372,7 @@ export type AsStoreObject(observable: Observable, mapFn: (value: V) => R | PromiseLike, catchFn?: (error: any) => R | PromiseLike): Observable; // @internal @@ -1004,7 +1003,7 @@ type Exact = (x: T) => T; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -1018,7 +1017,7 @@ interface ExecutionPatchIncrementalResult, TExtensio incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -1033,7 +1032,7 @@ interface ExecutionPatchInitialResult, TExtensions = // Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -1360,7 +1359,7 @@ export type InclusionDirectives = Array<{ ifArgument: ArgumentNode; }>; -// @public (undocumented) +// @public @deprecated (undocumented) interface IncrementalPayload { // (undocumented) data: TData | null; @@ -1488,7 +1487,7 @@ interface InternalRefetchQueriesOptions, TResult } // @public (undocumented) -type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // Warning: (ae-forgotten-export) The symbol "RefetchQueryDescriptor" needs to be exported by the entry point index.d.ts // @@ -1635,7 +1634,7 @@ export type IsStrictlyAny = UnionToIntersection_2> extends nev // @public (undocumented) export function isSubscriptionOperation(document: DocumentNode): boolean; -// @public (undocumented) +// @public @deprecated (undocumented) export function iterateObserversSafely(observers: Set>, method: keyof Observer, argument?: A): void; // @public (undocumented) @@ -1954,7 +1953,7 @@ type MutationQueryReducersMap = ApolloCache> extends MutationBaseOptions { // Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts fetchPolicy?: MutationFetchPolicy; @@ -2057,6 +2056,8 @@ interface NormalizedCacheObject { export { Observable } +// Warning: (ae-forgotten-export) The symbol "ApolloQueryResult" needs to be exported by the entry point index.d.ts +// // @public (undocumented) class ObservableQuery extends Observable>> { constructor({ queryManager, queryInfo, options, }: { @@ -2073,9 +2074,9 @@ class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -2087,7 +2088,7 @@ class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -2098,21 +2099,21 @@ class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): ObservableSubscription; // (undocumented) resubscribeAfterError(observer: Observer>): ObservableSubscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -2169,7 +2170,7 @@ type OperationVariables = Record; // @public (undocumented) type OptionsUnion = WatchQueryOptions | QueryOptions | MutationOptions; -// @public (undocumented) +// @public @deprecated (undocumented) type Path = ReadonlyArray; // @public (undocumented) @@ -2538,7 +2539,7 @@ interface RefetchQueriesOptions, TResult> { } // @public (undocumented) -type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // Warning: (ae-forgotten-export) The symbol "RefetchQueriesPromiseResults" needs to be exported by the entry point index.d.ts // @@ -2991,13 +2992,13 @@ interface WriteContext extends ReadMergeModifyContext { // src/cache/inmemory/types.ts:139:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts // src/cache/inmemory/writeToStore.ts:65:7 - (ae-forgotten-export) The symbol "MergeTree" needs to be exported by the entry point index.d.ts // src/core/LocalState.ts:71:3 - (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:130:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:131:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:143:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:144:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:160:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:415:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/types.ts:396:2 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts // src/core/types.ts:396:2 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:357:2 - (ae-forgotten-export) The symbol "UpdateQueryOptions" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:366:2 - (ae-forgotten-export) The symbol "UpdateQueryOptions" needs to be exported by the entry point index.d.ts // src/utilities/graphql/storeUtils.ts:226:12 - (ae-forgotten-export) The symbol "storeKeyNameStringify" needs to be exported by the entry point index.d.ts // src/utilities/policies/pagination.ts:76:3 - (ae-forgotten-export) The symbol "TRelayEdge" needs to be exported by the entry point index.d.ts // src/utilities/policies/pagination.ts:77:3 - (ae-forgotten-export) The symbol "TRelayPageInfo" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report-utilities_subscriptions_urql.api.md b/.api-reports/api-report-utilities_subscriptions_urql.api.md index 88c095736ad..78b63288010 100644 --- a/.api-reports/api-report-utilities_subscriptions_urql.api.md +++ b/.api-reports/api-report-utilities_subscriptions_urql.api.md @@ -8,7 +8,7 @@ import { Observable } from 'zen-observable-ts'; // Warning: (ae-forgotten-export) The symbol "CreateMultipartSubscriptionOptions" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) export function createFetchMultipartSubscription(uri: string, { fetch: preferredFetch, headers }?: CreateMultipartSubscriptionOptions): ({ query, variables, }: { query?: string; variables: undefined | Record; diff --git a/.api-reports/api-report.api.md b/.api-reports/api-report.api.md index 71088eb6e75..32d4a702efa 100644 --- a/.api-reports/api-report.api.md +++ b/.api-reports/api-report.api.md @@ -95,7 +95,7 @@ export abstract class ApolloCache implements DataProxy { } // @public -export class ApolloClient implements DataProxy { +export class ApolloClient implements DataProxy { // (undocumented) __actionHookForDevTools(cb: () => any): void; constructor(options: ApolloClientOptions); @@ -139,9 +139,9 @@ export class ApolloClient implements DataProxy { queryDeduplication: boolean; readFragment(options: DataProxy.Fragment, optimistic?: boolean): Unmasked | null; readQuery(options: DataProxy.Query, optimistic?: boolean): Unmasked | null; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; - refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; - resetStore(): Promise[] | null>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + refetchQueries = ApolloCache, TResult = Promise>>(options: RefetchQueriesOptions): RefetchQueriesResult; + resetStore(): Promise[] | null>; restore(serializedState: TCacheShape): ApolloCache; setLink(newLink: ApolloLink): void; // @deprecated @@ -278,13 +278,13 @@ export class ApolloLink { getMemoryInternals?: () => unknown; // @internal readonly left?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) protected onError(error: any, observer?: Observer): false | void; // (undocumented) request(operation: Operation, forward?: NextLink): Observable | null; // @internal readonly right?: ApolloLink; - // (undocumented) + // @deprecated (undocumented) setOnError(fn: ApolloLink["onError"]): this; // (undocumented) static split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink; @@ -357,7 +357,7 @@ type BackgroundQueryHookOptionsNoInfer = ApolloCache> extends MutationSharedOptions { client?: ApolloClient; // @deprecated @@ -369,14 +369,14 @@ export interface BaseMutationOptions extends SharedWatchQueryOptions { client?: ApolloClient; context?: DefaultContext; ssr?: boolean; } -// @public (undocumented) +// @public @deprecated (undocumented) export interface BaseSubscriptionOptions { client?: ApolloClient; context?: DefaultContext; @@ -925,7 +925,7 @@ export const execute: typeof ApolloLink.execute; // Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) export interface ExecutionPatchIncrementalResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data?: never; @@ -937,7 +937,7 @@ export interface ExecutionPatchIncrementalResult, TE incremental?: IncrementalPayload[]; } -// @public (undocumented) +// @public @deprecated (undocumented) export interface ExecutionPatchInitialResult, TExtensions = Record> extends ExecutionPatchResultBase { // (undocumented) data: TData | null | undefined; @@ -949,7 +949,7 @@ export interface ExecutionPatchInitialResult, TExten incremental?: never; } -// @public (undocumented) +// @public @deprecated (undocumented) export type ExecutionPatchResult, TExtensions = Record> = ExecutionPatchInitialResult | ExecutionPatchIncrementalResult; // @public (undocumented) @@ -1118,10 +1118,10 @@ type From = StoreObject | Reference | FragmentType> | st // @public (undocumented) export const from: typeof ApolloLink.from; -// @public (undocumented) +// @public @deprecated (undocumented) export function fromError(errorValue: any): Observable; -// @public (undocumented) +// @public @deprecated (undocumented) export function fromPromise(promise: Promise): Observable; // @internal @@ -1280,7 +1280,7 @@ interface IgnoreModifier { // @public (undocumented) const _ignoreModifier: unique symbol; -// @public (undocumented) +// @public @deprecated (undocumented) export interface IncrementalPayload { // (undocumented) data: TData | null; @@ -1391,7 +1391,7 @@ export interface InternalRefetchQueriesOptions, } // @public (undocumented) -export type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; +export type InternalRefetchQueriesResult = TResult extends boolean ? Promise> : TResult; // @public (undocumented) export type InternalRefetchQueryDescriptor = RefetchQueryDescriptor | QueryOptions; @@ -1518,7 +1518,7 @@ const _invalidateModifier: unique symbol; // @public (undocumented) type IsAny = 0 extends 1 & T ? true : false; -// @public (undocumented) +// @public @deprecated (undocumented) export function isApolloError(err: Error): err is ApolloError; // @public @@ -1907,7 +1907,7 @@ export interface MutationResult { // Warning: (ae-forgotten-export) The symbol "MutationBaseOptions" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public @deprecated (undocumented) interface MutationSharedOptions = ApolloCache> extends MutationBaseOptions { fetchPolicy?: MutationFetchPolicy; keepRootFields?: boolean; @@ -2035,9 +2035,9 @@ export class ObservableQuery>>; // (undocumented) getCurrentResult(saveAsLastResult?: boolean): ApolloQueryResult>; - // (undocumented) + // @deprecated (undocumented) getLastError(variablesMustMatch?: boolean): ApolloError | undefined; - // (undocumented) + // @deprecated (undocumented) getLastResult(variablesMustMatch?: boolean): ApolloQueryResult | undefined; // (undocumented) hasObservers(): boolean; @@ -2049,7 +2049,7 @@ export class ObservableQuery; // (undocumented) get query(): TypedDocumentNode; - // (undocumented) + // @deprecated (undocumented) readonly queryId: string; // (undocumented) readonly queryName?: string; @@ -2062,21 +2062,21 @@ export class ObservableQuery>, newNetworkStatus?: NetworkStatus): Concast>; // @internal (undocumented) resetDiff(): void; - // (undocumented) + // @deprecated (undocumented) resetLastResults(): void; // @internal (undocumented) protected resetNotifications(): void; - // (undocumented) + // @deprecated (undocumented) resetQueryStoreErrors(): void; // (undocumented) resubscribeAfterError(onNext: (value: ApolloQueryResult>) => void, onError?: (error: any) => void, onComplete?: () => void): ObservableSubscription; // (undocumented) resubscribeAfterError(observer: Observer>): ObservableSubscription; - // (undocumented) + // @deprecated (undocumented) result(): Promise>>; // @internal (undocumented) protected scheduleNotify(): void; - // (undocumented) + // @deprecated (undocumented) setOptions(newOptions: Partial>): Promise>>; setVariables(variables: TVariables): Promise> | void>; // (undocumented) @@ -2088,7 +2088,7 @@ export class ObservableQuery { fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & { updateQuery?: (previousQueryResult: Unmasked, options: { @@ -2181,7 +2181,7 @@ export namespace parser { resetCache: () => void; } -// @public (undocumented) +// @public @deprecated (undocumented) export type Path = ReadonlyArray; // @public (undocumented) @@ -2317,7 +2317,7 @@ export interface QueryDataOptions; } -// @public (undocumented) +// @public @deprecated (undocumented) export interface QueryFunctionOptions extends BaseQueryOptions { // @internal (undocumented) defaultOptions?: Partial>; @@ -2670,7 +2670,7 @@ export interface RefetchQueriesOptions, TResult> // Warning: (ae-forgotten-export) The symbol "IsStrictlyAny" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? ApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; +export type RefetchQueriesPromiseResults = IsStrictlyAny extends true ? any[] : TResult extends boolean ? InteropApolloQueryResult[] : TResult extends PromiseLike ? U[] : TResult[]; // @public (undocumented) export interface RefetchQueriesResult extends Promise> { @@ -2959,10 +2959,10 @@ export interface SuspenseQueryHookOptions = unionToIntersection 0 : never> extends ((x: infer U) => 0) ? U : never; -// @public (undocumented) +// @public @deprecated (undocumented) export const throwServerError: (response: Response, result: any, message: string) => never; -// @public (undocumented) +// @public @deprecated (undocumented) export function toPromise(observable: Observable): Promise; // @public (undocumented) @@ -3409,8 +3409,8 @@ interface WriteContext extends ReadMergeModifyContext { // src/cache/inmemory/policies.ts:162:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts // src/cache/inmemory/policies.ts:162:3 - (ae-forgotten-export) The symbol "KeyArgsFunction" needs to be exported by the entry point index.d.ts // src/cache/inmemory/types.ts:139:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:130:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts -// src/core/ObservableQuery.ts:131:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:143:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts +// src/core/ObservableQuery.ts:144:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:160:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:415:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts From 4e3953b4da458ff4e4ee5038228a6978141809e8 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:19:24 -0600 Subject: [PATCH 41/48] Update size limits --- .size-limits.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.size-limits.json b/.size-limits.json index 5422bb58d2f..7a12ec90d69 100644 --- a/.size-limits.json +++ b/.size-limits.json @@ -1,4 +1,4 @@ { - "dist/apollo-client.min.cjs": 42678, - "import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 34730 + "dist/apollo-client.min.cjs": 42745, + "import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 34813 } From e144dbacdff66dc6bf7d97e14c4316c48f7b6bdc Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 27 Jun 2025 18:20:46 -0600 Subject: [PATCH 42/48] Add changeset --- .changeset/breezy-lions-rule.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/breezy-lions-rule.md diff --git a/.changeset/breezy-lions-rule.md b/.changeset/breezy-lions-rule.md new file mode 100644 index 00000000000..8f5190d5536 --- /dev/null +++ b/.changeset/breezy-lions-rule.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": minor +--- + +Add deprecations and warnings to remaining APIs changed in Apollo Client 4.0. From 2031d10f8e361b0d7503c551e546e1fa5dbd5328 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 30 Jun 2025 12:43:14 +0200 Subject: [PATCH 43/48] adjust comment --- src/utilities/subscriptions/urql/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilities/subscriptions/urql/index.ts b/src/utilities/subscriptions/urql/index.ts index e1b2387ac21..14d717a005b 100644 --- a/src/utilities/subscriptions/urql/index.ts +++ b/src/utilities/subscriptions/urql/index.ts @@ -13,8 +13,8 @@ const backupFetch = maybe(() => fetch); /** * @deprecated `createFetchMultipartSubscription` will be removed in Apollo - * Client 4.0. `urql` has native support for Apollo multipart subscriptions and - * should be used instead. + * Client 4.0. `urql` has native support for Apollo multipart subscriptions, + * so you don't need to use this function anymore. */ export function createFetchMultipartSubscription( uri: string, From 77fb16e4d188458fcdaac1dbc5b1ec76d1f35132 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 30 Jun 2025 16:49:22 +0200 Subject: [PATCH 44/48] add types to deprecations --- src/react/hooks/internal/useWarnRemoved.ts | 7 +- src/utilities/deprecation/index.ts | 116 ++++++++++++++++----- 2 files changed, 97 insertions(+), 26 deletions(-) diff --git a/src/react/hooks/internal/useWarnRemoved.ts b/src/react/hooks/internal/useWarnRemoved.ts index 5114aacd4b5..73295655cd6 100644 --- a/src/react/hooks/internal/useWarnRemoved.ts +++ b/src/react/hooks/internal/useWarnRemoved.ts @@ -1,7 +1,10 @@ import * as React from "rehackt"; -import { warnDeprecated } from "../../../utilities/deprecation/index.js"; +import { + DeprecationName, + warnDeprecated, +} from "../../../utilities/deprecation/index.js"; -export function useWarnRemoved(name: string, cb: () => void) { +export function useWarnRemoved(name: DeprecationName, cb: () => void) { "use no memo"; const didWarn = React.useRef(false); diff --git a/src/utilities/deprecation/index.ts b/src/utilities/deprecation/index.ts index 21ce78c628b..651481159dc 100644 --- a/src/utilities/deprecation/index.ts +++ b/src/utilities/deprecation/index.ts @@ -9,25 +9,90 @@ type WithValueArgs = [ thisArg?: TThis | undefined, ]; -type DeprecationName = - | "addTypename" - | "canonizeResults" - | "connectToDevTools" - | "getLastError" - | "getLastResult" - | "graphql" - | "observableQuery.result" - | "parser" - | "resetLastResults" - | "withQuery" - | "withMutation" - | "withSubscription" - | "" - | "" - | ""; - -function isMuted(name: string) { - return (slot.getValue() || []).includes(name as string); +export type PossibleDeprecations = { + "cache.readQuery": ["canonizeResults"]; + "cache.readFragment": ["canonizeResults"]; + "cache.updateQuery": ["canonizeResults"]; + "cache.updateFragment": ["canonizeResults"]; + InMemoryCache: ["addTypename", "canonizeResults"]; + "cache.read": ["canonizeResults"]; + "cache.diff": ["canonizeResults"]; + "cache.gc": ["resetResultIdentities"]; + ApolloClient: [ + "connectToDevTools", + "uri", + "credentials", + "headers", + "name", + "version", + "typeDefs", + ]; + "client.watchQuery": ["canonizeResults", "partialRefetch"]; + "client.query": ["canonizeResults", "notifyOnNetworkStatusChange"]; + setOptions: ["canonizeResults"]; + useBackgroundQuery: ["canonizeResults"]; + useFragment: ["canonizeResults"]; + useLazyQuery: [ + "canonizeResults", + "variables", + "context", + "onCompleted", + "onError", + "defaultOptions", + "initialFetchPolicy", + "partialRefetch", + ]; + "useLazyQuery.execute": [ + "initialFetchPolicy", + "onCompleted", + "onError", + "defaultOptions", + "partialRefetch", + "canonizeResults", + "query", + "ssr", + "client", + "fetchPolicy", + "nextFetchPolicy", + "refetchWritePolicy", + "errorPolicy", + "pollInterval", + "notifyOnNetworkStatusChange", + "returnPartialData", + "skipPollAttempt", + ]; + useLoadableQuery: ["canonizeResults"]; + useMutation: ["ignoreResults"]; + useQuery: [ + "canonizeResults", + "partialRefetch", + "defaultOptions", + "onCompleted", + "onError", + ]; + useSuspenseQuery: ["canonizeResults"]; + preloadQuery: ["canonizeResults"]; + MockedProvider: ["connectToDevTools", "addTypename"]; + ObservableQuery: [ + "observableQuery.result", + "getLastResult", + "getLastError", + "resetLastResults", + "setOptions", + ]; + HOC: [ + "graphql" | "withQuery" | "withMutation" | "withSubscription", + "parser", + ]; + RenderProps: ["" | "" | ""]; +}; + +export type DeprecationName = + | keyof PossibleDeprecations + | NonNullable[number]; + +function isMuted(name: DeprecationName) { + return (slot.getValue() || []).includes(name); } export function muteDeprecations( @@ -37,13 +102,16 @@ export function muteDeprecations( return slot.withValue(Array.isArray(name) ? name : [name], ...args); } -export function warnRemovedOption>( +export function warnRemovedOption< + TOptions extends Record, + CallSite extends keyof PossibleDeprecations, +>( options: TOptions, - name: keyof TOptions, - callSite: string, + name: keyof TOptions & PossibleDeprecations[CallSite][number], + callSite: CallSite, recommendation: string = "Please remove this option." ) { - warnDeprecated(name as string, () => { + warnDeprecated(name as DeprecationName, () => { if (name in options) { invariant.warn( "[%s]: `%s` is deprecated and will be removed in Apollo Client 4.0. %s", @@ -55,7 +123,7 @@ export function warnRemovedOption>( }); } -export function warnDeprecated(name: string, cb: () => void) { +export function warnDeprecated(name: DeprecationName, cb: () => void) { if (!isMuted(name)) { cb(); } From 7420783b2874f324466bb89c999d8a0e702bda11 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 30 Jun 2025 16:49:46 +0200 Subject: [PATCH 45/48] allow to globally disable deprecations --- src/utilities/deprecation/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utilities/deprecation/index.ts b/src/utilities/deprecation/index.ts index 651481159dc..fc414efd896 100644 --- a/src/utilities/deprecation/index.ts +++ b/src/utilities/deprecation/index.ts @@ -1,5 +1,5 @@ import { Slot } from "optimism"; -import { invariant } from "../globals/index.js"; +import { invariant, global } from "../globals/index.js"; const slot = new Slot(); @@ -92,7 +92,10 @@ export type DeprecationName = | NonNullable[number]; function isMuted(name: DeprecationName) { - return (slot.getValue() || []).includes(name); + return ( + !!(global as any)[Symbol.for("apollo.deprecations")] || + (slot.getValue() || []).includes(name) + ); } export function muteDeprecations( From dd1cdd49b7902b9734d132179281d35cf1e0dd49 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 30 Jun 2025 17:18:14 +0200 Subject: [PATCH 46/48] mute deprecation warnings in tests, fix one missed invariant warning --- src/core/__tests__/ObservableQuery.ts | 6 +++++- src/link/core/ApolloLink.ts | 9 ++++++--- .../react/__tests__/MockedProvider.test.tsx | 5 +++++ src/utilities/deprecation/index.ts | 20 ++++++++++++++----- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/core/__tests__/ObservableQuery.ts b/src/core/__tests__/ObservableQuery.ts index 98e1e002cb0..2e5120e9b3c 100644 --- a/src/core/__tests__/ObservableQuery.ts +++ b/src/core/__tests__/ObservableQuery.ts @@ -27,7 +27,10 @@ import { expectTypeOf } from "expect-type"; import { SubscriptionObserver } from "zen-observable-ts"; import { waitFor } from "@testing-library/react"; import { ObservableStream, spyOnConsole } from "../../testing/internal"; -import { muteDeprecations } from "../../utilities/deprecation"; +import { + muteDeprecations, + withDisabledDeprecations, +} from "../../utilities/deprecation"; export const mockFetchQuery = (queryManager: QueryManager) => { const fetchConcastWithInfo = queryManager["fetchConcastWithInfo"]; @@ -1827,6 +1830,7 @@ describe("ObservableQuery", () => { it("should warn if passed { variables } and query does not declare $variables", async () => { using _ = spyOnConsole("warn"); + using __ = withDisabledDeprecations(); const queryWithVarsVar = gql` query QueryWithVarsVar($vars: [String!]) { diff --git a/src/link/core/ApolloLink.ts b/src/link/core/ApolloLink.ts index 51f964b72a3..a7b7918dae5 100644 --- a/src/link/core/ApolloLink.ts +++ b/src/link/core/ApolloLink.ts @@ -14,6 +14,7 @@ import { createOperation, transformOperation, } from "../utils/index.js"; +import { warnDeprecated } from "../../utilities/deprecation/index.js"; function passthrough(op: Operation, forward: NextLink) { return (forward ? forward(op) : Observable.of()) as Observable; @@ -145,9 +146,11 @@ export class ApolloLink { observer?: Observer ): false | void { if (__DEV__) { - invariant.warn( - "[ApolloLink] `onError` is deprecated and will be removed with Apollo Client 4.0. Please discontinue using it." - ); + warnDeprecated("onError", () => { + invariant.warn( + "[ApolloLink] `onError` is deprecated and will be removed with Apollo Client 4.0. Please discontinue using it." + ); + }); } if (observer && observer.error) { observer.error(error); diff --git a/src/testing/react/__tests__/MockedProvider.test.tsx b/src/testing/react/__tests__/MockedProvider.test.tsx index 8751429cce9..6c95879d7e7 100644 --- a/src/testing/react/__tests__/MockedProvider.test.tsx +++ b/src/testing/react/__tests__/MockedProvider.test.tsx @@ -11,6 +11,7 @@ import { QueryResult } from "../../../react/types/types"; import { ApolloLink, FetchResult } from "../../../link/core"; import { Observable } from "zen-observable-ts"; import { ApolloError } from "../../../errors"; +import { withDisabledDeprecations } from "../../../utilities/deprecation"; const variables = { username: "mock_username", @@ -870,6 +871,8 @@ describe("General use", () => { it("shows a warning in the console when there is no matched mock", async () => { const consoleSpy = jest.spyOn(console, "warn").mockImplementation(() => {}); + + using _ = withDisabledDeprecations(); let finished = false; function Component({ ...variables }: Variables) { const { loading } = useQuery(query, { variables }); @@ -915,6 +918,7 @@ describe("General use", () => { it("silences console warning for unmatched mocks when `showWarnings` is `false`", async () => { const consoleSpy = jest.spyOn(console, "warn"); + using _ = withDisabledDeprecations(); let finished = false; function Component({ ...variables }: Variables) { const { loading } = useQuery(query, { variables }); @@ -957,6 +961,7 @@ describe("General use", () => { it("silences console warning for unmatched mocks when passing `showWarnings` to `MockLink` directly", async () => { const consoleSpy = jest.spyOn(console, "warn"); + using _ = withDisabledDeprecations(); let finished = false; function Component({ ...variables }: Variables) { const { loading } = useQuery(query, { variables }); diff --git a/src/utilities/deprecation/index.ts b/src/utilities/deprecation/index.ts index fc414efd896..a5ae0c7c904 100644 --- a/src/utilities/deprecation/index.ts +++ b/src/utilities/deprecation/index.ts @@ -1,5 +1,8 @@ import { Slot } from "optimism"; -import { invariant, global } from "../globals/index.js"; +import { invariant, global as untypedGlobal } from "../globals/index.js"; + +const muteAllDeprecations = Symbol.for("apollo.deprecations"); +const global = untypedGlobal as { [muteAllDeprecations]?: boolean }; const slot = new Slot(); @@ -92,10 +95,7 @@ export type DeprecationName = | NonNullable[number]; function isMuted(name: DeprecationName) { - return ( - !!(global as any)[Symbol.for("apollo.deprecations")] || - (slot.getValue() || []).includes(name) - ); + return global[muteAllDeprecations] || (slot.getValue() || []).includes(name); } export function muteDeprecations( @@ -131,3 +131,13 @@ export function warnDeprecated(name: DeprecationName, cb: () => void) { cb(); } } + +export function withDisabledDeprecations() { + const prev = global[muteAllDeprecations]; + global[muteAllDeprecations] = true; + return { + [Symbol.dispose]() { + global[muteAllDeprecations] = prev; + }, + }; +} From 14b4cb7aacdaeaab3f4e4731531df07f5fcee07f Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 30 Jun 2025 17:25:00 +0200 Subject: [PATCH 47/48] fix imports --- src/react/hooks/internal/useWarnRemoved.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/react/hooks/internal/useWarnRemoved.ts b/src/react/hooks/internal/useWarnRemoved.ts index 73295655cd6..2bdf4b27bae 100644 --- a/src/react/hooks/internal/useWarnRemoved.ts +++ b/src/react/hooks/internal/useWarnRemoved.ts @@ -1,6 +1,7 @@ import * as React from "rehackt"; +import type { + DeprecationName} from "../../../utilities/deprecation/index.js"; import { - DeprecationName, warnDeprecated, } from "../../../utilities/deprecation/index.js"; From 1c18c4d902a2d2cc4752ec2166ee17567a8324e5 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 30 Jun 2025 17:33:46 +0200 Subject: [PATCH 48/48] chores --- .size-limits.json | 4 ++-- src/react/hooks/internal/useWarnRemoved.ts | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.size-limits.json b/.size-limits.json index 7a12ec90d69..51c4ce3c9dd 100644 --- a/.size-limits.json +++ b/.size-limits.json @@ -1,4 +1,4 @@ { - "dist/apollo-client.min.cjs": 42745, - "import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 34813 + "dist/apollo-client.min.cjs": 42760, + "import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 34803 } diff --git a/src/react/hooks/internal/useWarnRemoved.ts b/src/react/hooks/internal/useWarnRemoved.ts index 2bdf4b27bae..bf5745718be 100644 --- a/src/react/hooks/internal/useWarnRemoved.ts +++ b/src/react/hooks/internal/useWarnRemoved.ts @@ -1,9 +1,6 @@ import * as React from "rehackt"; -import type { - DeprecationName} from "../../../utilities/deprecation/index.js"; -import { - warnDeprecated, -} from "../../../utilities/deprecation/index.js"; +import type { DeprecationName } from "../../../utilities/deprecation/index.js"; +import { warnDeprecated } from "../../../utilities/deprecation/index.js"; export function useWarnRemoved(name: DeprecationName, cb: () => void) { "use no memo";