-
Notifications
You must be signed in to change notification settings - Fork 101
apollo client resetStore with apollo-link-state triggers Error: Network error: Cannot read property of undefined #198
Comments
|
i added client.onResetStore(stateLink.writeDefaults); the error exists with or without this callback |
Agreed, |
looking into the code i realized that this is actually an apollo client bug ... not related to apollo-link-state |
ok, i guess the trick is adding query to state resolvers like mentioned in #156 by Scott (@stolinski) |
yeap :) that fixed it :) |
Maybe you are seeing different results than I, but simply adding an empty/dummy query to my resolvers map is not fixing anything. It masks the problem by causing the new (after a |
@wKovacs64 u jinxed my code ... i can swear it was working yesterday ... now indeed i get Missing field :( here is the updated link: i really hope we aren't the only ones tracking this issue :) |
Maybe Apollo will clone @peggyrayzis for additional bandwidth. 😉 🤞 |
@wowzaaa Thank you for opening the issues! Really appreciate the codesandbox! It made spinning up on the project really nice. Please check out #202. It is sort of a temporary fix, since the query resolvers don't see the defaults yet. Let me know if #202 is what you are looking for or you need the @wKovacs64 Thank you for the followup! Hopefully I can live up to a clone of peggy 🙏 Please take a peek at #202 when you get a chance! |
@evan hi and thank you for your help ... i added Query: () => {}, to the resolvers but not it triggers a warning that Missing field counter in {} thanks |
@wKovacs64 did u do anything else than adding thanks |
@wowzaaa I didn't add
At that point, your project will be using your local copy of Note: |
awesoeme response thanks :) yes it works :) |
I am trying this a second time because the previous issue was closed without a single test #194
so the error is replicated here https://codesandbox.io/s/v69v13w0o0
you will see the error in the console after clicking the reset button which does client.resetStore
i really hope we can sort this out
thanks
The text was updated successfully, but these errors were encountered: