<!-- Thanks for filing an issue on Apollo Client! Please make sure that you include the following information to ensure that your issue is actionable. If you don't follow the template, your issue may end up being closed without anyone looking at it carefully, because it is not actionable for us without the information in this template. **PLEASE NOTE:** Feature requests and non-bug related discussions are no longer managed in this repo. Feature requests should be opened in https://github.com/apollographql/apollo-feature-requests. --> **Intended outcome:** The `onCompleted` option provided to `useQuery` should not be called after data was changed from an update via `cache.writeQuery` (where it was just a local cache update without a network request). <!-- What you were trying to accomplish when the bug occurred, and as much code as possible related to the source of the problem. --> **Actual outcome:** <!-- A description of what actually happened, including a screenshot or copy-paste of any related error messages, logs, or other output that might be related. Places to look for information include your browser console, server console, and network logs. Please avoid non-specific phrases like “didn’t work” or “broke”. --> When using `cache.writeQuery` to update local data, the `onCompleted` option of a `useQuery` for the same query gets called. This is a change from what we see on 3.4.x, where the `onCompleted` callback is not called after these cache updates. **How to reproduce the issue:** <!-- If possible, please create a reproduction using https://github.com/apollographql/react-apollo-error-template and link to it here. If you prefer an in-browser way to create reproduction, try: https://codesandbox.io/s/github/apollographql/react-apollo-error-template Instructions for how the issue can be reproduced by a maintainer or contributor. Be as specific as possible, and only mention what is necessary to reproduce the bug. If possible, try to isolate the exact circumstances in which the bug occurs and avoid speculation over what the cause might be. --> https://github.com/lawrence-yu/react-apollo-error-onCompleted 1. After having it running locally, click on the button with "Update person's name via writeQuery". This does a cache write to append a `1` to a person's name, which is reflected in UI with the list of names. 2. In 3.6.8, note that the "onCompleted count" increases with each button click / cache write. 1. There's a `3.4.17` branch in the fork that can be used to see that, with each button click, the `onCompleted` count remains at 1 (the one being from after initial query completion). **Versions** <!-- Run the following command in your project directory, and paste its (automatically copied to clipboard) results here: `npx [email protected] --preset apollo --clipboard` --> ``` System: OS: Windows 10 10.0.19042 Binaries: Node: 16.13.2 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.18 - ~\.yarn\bin\yarn.CMD npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.27) npmPackages: @apollo/client: ^3.6.8 => 3.6.8 ``` **Other notes** The limited documentation for the `onCompleted` option leaves me unsure about what is the "correct" behavior. Is getting called by cache updates actually correct now? Or was the old behavior correct and this is an actual bug? Potentially related to: #9688 #10059