Apollo Hooks failing on first call and then returning previous response.
June 24, 2020 at 6:55pmApollo Hooks failing on first call and then returning previous response.
June 24, 2020 at 6:55pm (Edited 7 months ago)Hi Y'all! I'm currently facing this odd bug with Apollo hooks that fails the first mutation call and then returns the previous response on subsequent calls. At first I thought perhaps it was
loading
, but checking that prop reveals it is false and not loading. Any ideas on a cause? Thanks!June 24, 2020 at 7:12pm
That sounds like you're not using the hook correctly. See this post on reddit https://www.reddit.com/r/graphql/comments/h8sgo8/issue_with_usemutation_hook/
90% of the time, you should be using the
Promise
returned by calling mutate
, not the data
returned by the hook.