react-apollo icon indicating copy to clipboard operation
react-apollo copied to clipboard

onCompleted doesn't run when re-rendered component

Open dapapkung opened this issue 7 years ago • 2 comments

Here is my code:

https://gist.github.com/dafapramudya/98684603c3c465713f9c26858655ab62

Intended outcome:

Run onCompleted after mutation complete

Actual outcome:

It's because i put mutation in ternary condition, so if mutation is success, data.topup.Status will be changed. and if i remove that ternary condition, onCompleted method will run perfectly.

Any solution? Thank you.

How to reproduce the issue:

Version

  • apollo-client@<^2.4.2>
  • react-apollo@<^2.2.4>

dapapkung avatar Mar 21 '19 04:03 dapapkung

@dafapramudya Can you try using react-apollo 2.5.3 and post back if this is still an issue?

hwillson avatar Mar 27 '19 16:03 hwillson

@hwillson Wow thank you, now it's work perfectly.

dapapkung avatar Mar 27 '19 18:03 dapapkung