Giter VIP home page Giter VIP logo

Comments (11)

Risbot avatar Risbot commented on April 27, 2024 21

@alekbarszczewski

you can try this:
client.cache.reset()

from apollo.

Adverbly avatar Adverbly commented on April 27, 2024 6

For others with multiple clients, you can run this from inside a component:

Object.values(this.$apollo.provider.clients)
    .forEach(client => client.cache.reset())

from apollo.

AlexandreBonaventure avatar AlexandreBonaventure commented on April 27, 2024

related to apollographql/apollo-client#1509

from apollo.

jvbianchi avatar jvbianchi commented on April 27, 2024

I got the same problem.

from apollo.

jvbianchi avatar jvbianchi commented on April 27, 2024

Looks like react-apollo had the same issue, until this PR apollographql/react-apollo#531

There was this PR apollographql/apollo-client#1636 that introduced a new fetch policy "standby" for this kind of use case

from apollo.

gijo-varghese avatar gijo-varghese commented on April 27, 2024

@Akryum it would be very useful for others if you can add it to docs. Thanks @Risbot

from apollo.

stantoncbradley avatar stantoncbradley commented on April 27, 2024

@Risbot sharing your solution across related issues. thanks!

from apollo.

b4dnewz avatar b4dnewz commented on April 27, 2024

does cache.reset() clear the store data?
I rely on query result to show the profile data

apollo: {
    profile: GetProfile
}
<div v-if="profile">
// user data
</div>

When I call cache.reset() on logout the cache is cleared (i can see by inspecting $apollo object) but the store profile field/data is still populated and the div with the profile data does not disappear.

On logout I would like to clear cache and store data (without re-running queries) and get the view updated as it happen after a mutation for example.

What is the proper way to do it? Thanks in advance

from apollo.

bswank avatar bswank commented on April 27, 2024

Just found my way here & want to make sure you got your answer, @b4dnewz. You still need help with clearing your store?

from apollo.

b4dnewz avatar b4dnewz commented on April 27, 2024

@bswank actually with the latest version it does not happen, or at least I've not experienced it anymore
but if you want to share your thoughts and a clarification about the arguments it's well accepted 👍

from apollo.

marianocodes avatar marianocodes commented on April 27, 2024

@Akryum This ticket shouldn't be closed. Smart queries still ignore the skip function/flag when data is refetched

from apollo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.