Open
Description
Issue Description
I was having an issue yesterday, where a List of for example type Person would not update when a mutation returned an updated version of the same Person. I tried everything but couldn't get it to work. But I found out we recently updated apollo and the version where this stopped working seemed to be 3.13.5 that led me to the bug.
In the following circumstances, the query will stop being updated from other places in the cache:
- Have a state used as a variable in the query and in the skip condition. The skip condition should be false at first render
- The state gets set to a value that will turn the skip condition true. (Probably while the first request is still in flight)
- The state gets set to the initial value we had at first render
Now if a mutation, for example, gets an updated version of one of the items in the query, the query will not be updated.
Link to Reproduction
https://github.com/Shadowlauch/apollo-error
Reproduction Steps
- Clone the repo
- Run
npm install
- Run
npm start:server
- Run
npm start
- Open the browser and go to
http://localhost:3000
- Wait for the initial data to load
- Click on "Edit first person"
- If everything was working correctly, it should update the first person in the list to the name in the input field, but it will not.
@apollo/client
version
>=3.13.5
Metadata
Metadata
Assignees
Labels
No labels