From 1765668b7d495ef8a581f697bf9e4b7460455f13 Mon Sep 17 00:00:00 2001 From: Mike Molisani <37375674+mgmolisani@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:23:32 -0500 Subject: [PATCH] Nullish check devtools.enabled (#12093) Co-authored-by: Jerel Miller --- .changeset/angry-sheep-smile.md | 5 +++++ .size-limits.json | 4 ++-- src/core/ApolloClient.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/angry-sheep-smile.md diff --git a/.changeset/angry-sheep-smile.md b/.changeset/angry-sheep-smile.md new file mode 100644 index 00000000000..d1db8592e77 --- /dev/null +++ b/.changeset/angry-sheep-smile.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": patch +--- + +Fixed a bug when evaluating the devtools flag with the new syntax `devtools.enabled` that could result to `true` when explicitly set to `false`. diff --git a/.size-limits.json b/.size-limits.json index a87db882cdf..c3a79848a2b 100644 --- a/.size-limits.json +++ b/.size-limits.json @@ -1,4 +1,4 @@ { - "dist/apollo-client.min.cjs": 40266, - "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 33060 + "dist/apollo-client.min.cjs": 40269, + "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 33061 } diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 7dce981b88d..6ae37a8acd9 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -254,7 +254,7 @@ export class ApolloClient implements DataProxy { this.typeDefs = typeDefs; this.devtoolsConfig = { ...devtools, - enabled: devtools?.enabled || connectToDevTools, + enabled: devtools?.enabled ?? connectToDevTools, }; if (this.devtoolsConfig.enabled === undefined) {