-
Notifications
You must be signed in to change notification settings - Fork 743
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
GraphQLQueryWatcher doesn't update its dependent keys #1365
Comments
hey @designatednerd thanks for reaching out. I'm using Our use case is pagination using the Apollo cache. Mutation values gets to the store correctly but after I will run through the commits and PR's that you mentioned and will try to figure out what the problem with the previous behavior was. |
So I know some stuff changed around |
I'd either suggest reverting to or adding If you don't see problem with that I'm happy to open a PR. |
@designatednerd thanks for the links that you shared. I've checked them and I found the root cause of the problem. I'm pretty sure that if we bring back those lines it wouldn't break anything. |
Hi! Sorry, I was on vacation last week. I read your explanation here and I think I get it. I'll take a look at this today or tomorrow and see what I can figure out. |
With the
0.23.0
release Apollo changed the way it stores keys in theQueryWatcher
https://github.com/apollographql/apollo-ios/blob/main/Sources/Apollo/GraphQLQueryWatcher.swift#L73-L83The problem with this is that the watcher doesn't update its
dependentKeys
like it should. There is a commit that does that but I couldn't follow why it was changed:2b07e69
The problem that we are experiencing is that we are updating a query in the store with
ReadWriteTransaction
and in the previous versions the updated query captured the newly dependent keys, therefore when a change occured it was propagated to the result handler and now it's not.What's the reason behind this change and how can we workaround this? Was there a problem with the previous implementation in 0.22.0 https://github.com/apollographql/apollo-ios/blob/0.22.0/Sources/Apollo/GraphQLQueryWatcher.swift#L66-L68
The text was updated successfully, but these errors were encountered: