apollo-cache-redux icon indicating copy to clipboard operation
apollo-cache-redux copied to clipboard

use defaultNormalizedCacheFactory() instead of this.config.storeFactory()

Open aziz-haddad opened this issue 6 years ago • 5 comments

In newer version of apollo-cache-inmemory package they replaced this.config.storeFactory() by defaultNormalizedCacheFactory().

Also writeResultToStore should be imported from the StoreWriter class.

So unless you don't fix apollo-cache-inmemory version to 1.2.10, your package will not work anymore.

reference to the commit where they removed the use of storeFactory(): https://github.com/apollographql/apollo-client/commit/8200d31f41a203e78f120055b40f7350b10b4f9f#diff-f5213f6854434423f284afb3e369280f

aziz-haddad avatar Oct 15 '18 10:10 aziz-haddad

Thanks @aziz-haddad for noticing the issue and creating the PR. Will test that now.

rportugal avatar Oct 15 '18 10:10 rportugal

@aziz-haddad can you enable "Allow edits from maintainers" on this PR? There's a few changes I'd like to make. I've temporarily frozen the apollo-cache and apollo-cache-inmemory versions until we get this PR merged.

rportugal avatar Oct 15 '18 10:10 rportugal

@rportugal it is allowed.

aziz-haddad avatar Oct 15 '18 11:10 aziz-haddad

I am using this library with various apollo packages and upgrading to 0.1.2 results in Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue. I can't quite isolate what interaction of libraries is causing this. Any way I can assist in making these changes land and released?

truted avatar Oct 30 '18 22:10 truted

for what it's worth, we forked this PR, built in, and commited it, so for @truted and any others hitting issues after upgrading apollo-cache-inmemory to 1.3.x, you can yarn add apollo-cache-redux@lithodomosvr/apollo-cache-redux#e0eed5237b718673adbeccf7f2ac5f7f2b24e8c0 for the fix in the meanwhile

provided as is, no guarantees, etc.

meatwallace avatar Nov 11 '18 07:11 meatwallace