On mutation safari does not refetchQueries and some other weird behavior
Hi guys! I'm really struggling with this one since a few days ago. I've been testing my login mutation on different browsers, works fine on all of them except Safari. When I call my login mutation on safari it doesn't refetchQueries, a component wouldn't render and currentUser would not appear in 'account'. I also tried manually updating the cache:
graphql(login, {
name: 'loginMutation',
options: {
update: (proxy, { data: { login } }) => {
const data = proxy.readQuery({ query: currentUser });
data.currentUser = login;
proxy.writeQuery({ query: currentUser, data });
}
}
}),
graphql(currentUser, { name: 'account' })
when logging componentWillReceiveProps it rerenders 3 times, with empty account, account with currentUser and then with empty account again, so it's somehow deleting the cache or something... super weird but cant figgure it out, any help would be higly appretiated!
react-apollo - 2.1.0 safari - 11.0.3 (13604.5.6)
Thanks
specifying fetchPolicy 'cache-first' solved the issue for me.