-
Notifications
You must be signed in to change notification settings - Fork 130
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
No way to clear client cache #36
Comments
Alternatively, if there was a way to disable caching entirely, that would work also - I'd want to do caching at a higher level anyway - so request caching doesn't make sense in my use case. |
Hello @michaeleconomy Thanks for reporting this. I will take the part of adding Regarding your use-case, you can achieve this by scoping the cache to individual users and delete the database file once a user signs out. Example: https://github.com/aws-samples/aws-mobile-appsync-events-starter-ios/blob/master/EventsApp/AppDelegate.swift#L20 Here we are explicitly setting the database path. We can delete the file and create a new one for every user. Hope that helps. Thanks, |
+1 on this feature request |
+1 |
+1 |
1 similar comment
+1 |
PR #141 is already in master! |
This is released on 2.9.2. Please let us know if you have any issues. |
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems. |
Ok, so i'm struggling with this case:
i have a query that does "get info about the current user". It doesn't take an id as a parameter, instead depends on the users context.identity.cognitoIdentityId (iam auth).
The problem i have is: if you do that call, i believe it is caching the response, then if i sign out and sign back in (as a different user), i get the old user's information when i do the same call.
Perhaps i can play with the cache keys (so it contains the user id in it)? - i'm not sure how to set this:
appSyncClient?.apolloClient?.cacheKeyForObject = { $0["id"] }
I didn't see documentation for this method, but maybe i'm missing it?
Alternatively - it would be great to just expose appSyncClient.store.clearCache (i think this is a thing here: https://github.com/apollographql/apollo-ios/blob/master/Sources/Apollo/ApolloStore.swift)
Sorry if i'm not making sense - I'll be happy to go into more detail if needed.
The text was updated successfully, but these errors were encountered: