I want to utilize apollo cache with apollo-client api directly using fetchPolicy 'cache-and-network'. Seems that we have to use watchQuery api instead of query but unfortunately I couldn't make it work.
So could you guys please give me some example code to use 'watchQuery' to get data as what we get from 'query': loading, data, networkStatus...?
client.query({
query: Query.getUserById,
fetchPolicy: 'cache-and-network',
variables: { userId }
}).then(data => {
console.log(data.loading, data.getUserById)
})