Hi,
I have a few local field (@client) on app, apollo cache is persistent in local storage. After I update a client and add new local field, new client can’t read old cache field because in local storage new field not exist and as is described in docs Reading and writing data to the cache - Apollo GraphQL Docs readQuery return null.
Do you know how I should handle this? Why don’t return null only for one new field? Or should I stored also schema version and compare it, if not exist delete cache/localstorage? What is correct way to add @client fields to schema, when cache is persisted on client?
Use case, I had old client with local schema, apollo cache is persistant. Update client on new version with different local schema, and load cache from persistant storage, make query but return null because new field not exist in old schema, I can’t read any data, also don’t know when I should delete local cache. One hack is store separate version client and compare it on aplication start, if not patch delete persistent storage, but dont like the idea. Do you have something better? Thanks!