Open mg98 opened 4 years ago
Actually seeing a similar issue when setting no-cache
for individual queries.
When making a request the browser freezes while storing data in cache :(
Looks like I have something similar.
If I setup fetch-policy to no-cache
in createApolloClient, the cache still will work. It won't send the second query.
But if I set it for individual request, it works:
const response = await this.$apollo.query({
query: getForeignCitizens,
variables: this.filters,
fetchPolicy: 'no-cache'
})
This is so serious bug that I had to switch to a pure HTTP request. :(
any news on that?
Any news on this?
I can't reproduce on my side. Please provide a runnable reproduction.
Describe the bug The
fetchPolicy
'no-cache'
is supposed to disable the default behavior for GraphQL queries to take the cached response of the query and thus save on network requests. I always wanted this behavior but never got it working in my app. Now I have set up a fresh project just for demo and it is not working here either.To Reproduce Steps to reproduce the behavior:
Try to send the same graphql query two or more times and notice it will only send one network request.
I have setup a demo project for this: https://github.com/mg98/apollo-cache-not-working I created it with the Vue CLI and
vue add apollo
with pre setup configuration. Follow the readme to start the app. There will be a text explaining you how to test the behavior.Expected behavior Always send a network request, because I globally set
fetchPolicy
to'no-cache'
.Versions vue: 2.6.11 vue-apollo: 3.0.0.beta.11, I can also verify for 3.0.3