logaretm / villus

🏎 A tiny and fast GraphQL client for Vue.js
https://villus.dev
MIT License
790 stars 31 forks source link

Cache persist on IndexedDB? #195

Open frederikhors opened 1 year ago

frederikhors commented 1 year ago

Hi, I'm new to Vue and to villus.

I'm trying to understand if there is a way to persist the cache in IndexedDB.

Is there an example already?

Thank you for your amazing work!

logaretm commented 1 year ago

Hi, you could take a look at how cache plugin is implemented and swap the localstorage with indexed db calls.

Let me know if you need further guidance.

Perhaps the cache plugin should let you define your get and set methods to make the storage swappable.

frederikhors commented 1 year ago

I'm not using Vue yet, just wondering why we'll most likely start.

Anyway, I thought there was already some example and it would be nice to have it, but I think I'm not very good at writing code like this.