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

ApolloStore with "remove(key, cascade)" does not delete any records #79

Open
Tracked by #2331
ahetawal-p opened this issue Oct 14, 2020 · 1 comment
Open
Tracked by #2331

Comments

@ahetawal-p
Copy link

I am using apollo store to cascade delete my records using something like this:

val results = apolloClient.apolloStore.remove(CacheKey.from("Parent_KEY"), cascade = true)
results.execute()

And my Parent_KEY points to this record in DB:

{
"__typename":"MyRECORD",
"summary":"ApolloCacheReference{Summary_key_name}",
"children":["ApolloCacheReference{Summary_key_name_child1}","ApolloCacheReference{Summary_key_name_child2}"],
"parents":["ApolloCacheReference{Summary_key_name_parent1}","ApolloCacheReference{Summary_key_name_parent2}"]
}

Using the apolloStore.remove(CacheKey.from("Parent_KEY"), true) DOES NOT remove any records from my cache, however using apolloStore.remove(CacheKey.from("Parent_KEY")) only removes the Parent_KEY.

It seems cascade flag is not working as expected ?

Version
2.3.0

@mateuszkwiecinski
Copy link

I can share similar behavior also happens in 3.0.0 and I can share a repro

Removing a key with cascade=true seems to remove cache entries only from the first cache.

@BoD BoD transferred this issue from apollographql/apollo-kotlin Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants