-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird caching behavior #59
Comments
What do the mutation results look like? Did you define (Away until Monday, so may not respond until then.) |
@attheodo: Any new insights into this behavior? |
Hey @martijnwalraven the mutation for creating the
No, we're not defining |
If you haven't defined That won't help here however, because even if the new |
This is puzzling to me, I would expect the query to always return the cached results, so not including the newly added one. Could you confirm this is the behavior you're seeing? |
@martijnwalraven yes indeed, this is the behaviour we're seeing. |
When are identities added? Could this be a timing issue, where the difference is explained by query results either having been written to the cache or still being in flight? Also, is |
@martijnwalraven the identities are added as a result of user actions. When the mutation to add them is finished successfully, the collection view re-triggers the query to get them and reloads itself. I don't really think this is a timing issue. I might need to confirm with the platform team but yes I believe |
Just checking, but does the collection view wait for the result to be returned before reloading itself? If you perform the reload in the result handler, that should be ok. Are you using a query watcher or just a fetch? |
@martijnwalraven yes, we're obviously waiting for the new results to come by. No we're not using a query watcher yet, just a simple fetch. |
Could you try refetching (so not the original fetch) with |
Going to close this for lack of response, but feel free to reopen it if it is still an issue. |
Hey @martijnwalraven,
we've encountered a weird caching behavior around this query:
When we run our app, this query is executed first thing before anything else.
link_identities
are 0 when the app starts, even if we issue a mutation to add a newlinked_identity
and re-run theGetLinkedIdentities
query, it still returns 0 results.linked_identities
are > 0 when the app starts, when we issue a mutation to add a newlinked_identity
and re-reun theGetLinkedIdentities
query, it fetches back the proper number of results.Running the query with
cachePolicy: .fetchIgnoringCacheData
seems to solve the problem.Does this look normal in terms of how Apollo client is handling client-side caching or could this be a bug?
The text was updated successfully, but these errors were encountered: