Skip to content

fix(core): omit notifyOnNetworkStatusChange from executeQuery#337

Merged
bennypowers merged 2 commits into
mainfrom
fix/334-executeQuery-notifyOnNetworkStatusChange
Jul 20, 2026
Merged

fix(core): omit notifyOnNetworkStatusChange from executeQuery#337
bennypowers merged 2 commits into
mainfrom
fix/334-executeQuery-notifyOnNetworkStatusChange

Conversation

@bennypowers

Copy link
Copy Markdown
Member

Summary

  • Remove notifyOnNetworkStatusChange from executeQuery()'s client.query() call
  • Apollo Client 4 rejects this option on client.query() with an InvariantError -- it only applies to watchQuery()
  • Add regression test verifying the option is not passed

Context

The 3.0.0 release added notifyOnNetworkStatusChange: this.options.notifyOnNetworkStatusChange ?? true to three call sites. Two are correct (watchQuery() and subscribe() both hit client.watchQuery()). The third is in executeQuery(), which calls client.query() -- where AC4 throws.

Any controller using noAutoSubscribe + executeQuery() hits this immediately.

Test plan

  • New test asserts notifyOnNetworkStatusChange is not a property of client.query() args
  • All 1910 existing tests pass (0 failures, 1 skipped)

Fixes #334

Apollo Client 4's `client.query()` rejects `notifyOnNetworkStatusChange`
with an InvariantError -- the option only applies to `watchQuery()`.
The `executeQuery()` path was forwarding it unconditionally, breaking
any controller using `noAutoSubscribe` + `executeQuery()`.

Fixes #334

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 662dd06

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@apollo-elements/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for apollo-elements ready!

Name Link
🔨 Latest commit 42df632
🔍 Latest deploy log https://app.netlify.com/projects/apollo-elements/deploys/6a44a9332c79f20009119a07
😎 Deploy Preview https://deploy-preview-337--apollo-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for apollo-elements ready!

Name Link
🔨 Latest commit 662dd06
🔍 Latest deploy log https://app.netlify.com/projects/apollo-elements/deploys/6a44a956577b47000842fc2d
😎 Deploy Preview https://deploy-preview-337--apollo-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bennypowers
bennypowers merged commit c385a80 into main Jul 20, 2026
5 checks passed
@bennypowers
bennypowers deleted the fix/334-executeQuery-notifyOnNetworkStatusChange branch July 20, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ApolloQueryController.executeQuery() throws under Apollo Client 4: "notifyOnNetworkStatusChange option only supported on watchQuery"

1 participant