Skip to content
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

How to clear cache for a single query? #813

Closed
koenpunt opened this issue Oct 4, 2019 · 3 comments

Comments

@koenpunt
Copy link
Contributor

commented Oct 4, 2019

I'm having a list of users that I follow, and they can be unfollowed from that overview;

image

And that does update the cache for the individual item, but not for the list.

Is there a way to clear the cache for a specific query? Or should I be able to remove the updated item from the cache?

I've been looking at store.withinReadWriteTransaction

And what I want to achieve is something like;

let query = UserFollowingQuery(userId: "123")
store.withinReadWriteTransaction { transaction in
  try transaction.write(data: nil, forQuery: query)
}
@koenpunt koenpunt closed this Oct 4, 2019
@koenpunt koenpunt reopened this Oct 4, 2019
@designatednerd

This comment has been minimized.

Copy link
Collaborator

commented Oct 4, 2019

"Clearing the cache for a single query" isn't really possible, but you're on the right track for direct cache access to manipulate the cache if need be. Here's our documentation for updating results based on a query - does that help fill in the blanks?

@designatednerd

This comment has been minimized.

Copy link
Collaborator

commented Oct 8, 2019

@koenpunt Anything else I can help with here, or do you mind if I close this issue out?

@designatednerd

This comment has been minimized.

Copy link
Collaborator

commented Oct 16, 2019

Since I haven't heard back from @koenpunt for a while I'm going to close this one out - please feel free to re-open if you need more help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.