Зачем это делать:
const stateLink = withClientState({
cache,
resolvers: {
Mutation: {
updateNetworkStatus: (_, { isConnected }, { cache }) => {
const data = {
networkStatus: {
__typename: 'NetworkStatus',
id: 1,
isConnected
},
};
cache.writeData({ data }); // <--
return null; // <--
},
},
}
});
За это:
const stateLink = withClientState({
cache,
resolvers: {
Mutation: {
updateNetworkStatus: (_, { isConnected }, { cache }) => {
const data = {
networkStatus: {
__typename: 'NetworkStatus',
id: 1,
isConnected
},
};
return data; // <--
},
},
}
});