Skip to content

Commit c70b242

Browse files
committed
Add warning for connectToDevTools in MockedProvider
1 parent c806091 commit c70b242

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/testing/react/MockedProvider.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { ApolloLink } from "../../link/core/index.js";
1010
import type { Resolvers } from "../../core/index.js";
1111
import type { ApolloCache } from "../../cache/index.js";
1212
import type { DevtoolsOptions } from "../../core/ApolloClient.js";
13+
import { invariant } from "../../utilities/globals/index.js";
1314

1415
export interface MockedProviderProps<TSerializedCache = {}> {
1516
mocks?: ReadonlyArray<MockedResponse<any, any>>;
@@ -69,6 +70,14 @@ export class MockedProvider extends React.Component<
6970
showWarnings,
7071
connectToDevTools = false,
7172
} = this.props;
73+
if (__DEV__) {
74+
if ("connectToDevTools" in this.props) {
75+
invariant.warn(
76+
"`connectToDevTools` is deprecated and will be removed in Apollo Client 4.0. Please use `devtools.enabled` instead."
77+
);
78+
}
79+
}
80+
7281
const client = new ApolloClient({
7382
cache: cache || new Cache({ addTypename }),
7483
defaultOptions,

0 commit comments

Comments
 (0)