Skip to content

charle692/-apollo-client-stale-onCompleted-data

Repository files navigation

@apollo/client mutation onCompleted contains stale data

Whenever a mutation's onCompleted hook references data from a query that is being updated by the mutation, the data reference is stale. It contains old data representing the initial load rather than the result from the mutation.

Instructions

  1. Run npm install
  2. Run npm test for the reproduction, I've added console.log statements to illustrate the problem as well as an assertion that passes in version: 3.4.17

Notes

All the code is contained in TestComponent.tsx. TestComponent.test.tsx contains a test to reproduce/demonstrate the problem.

About

@apollo/client mutation onCompleted contains stale data reproduction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published