You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This relates to our work in our web Client to offer a useFragment hook, and there has been some interest in this same level of functionality in iOS.
useFragment is a read-only reactive/live binding into the cache, providing an always-up-to-date view of whatever data the cache currently contains for a given fragment.
It makes sense to want to watch just a fragment but it's not possible in iOS at the moment; it looks like our watcher functions are restricted to queries only.
The text was updated successfully, but these errors were encountered:
From a discussion I had with the requester of this feature:
There is sort of a work around where you can create a getFoo(uuid: ID!): Foo query then have the cache know how to lookup that entity even if it came in a list. But would be nice to have it as a first class concept and it seems like it could be possible given things are already effectively stored this way in the normalized cache.
@jpvajda what do you mean "even if it came in a list". Doesn't cacheKeyForObject = { $0["id"] } suffice if the Foo id is included in both the list query and the getFoo query?
I'm curious how to achieve this. I don't quite get the Foo workaround @jpvajda.
I'm trying to observe changes to an array of objects that are modified from a different screen. The objects are a shared fragment.
Screen 1: Query that returns a list of objects
Screen 2: Can add or remove objects
Screen 1: Would like to receive updates when objects are added or removed from Screen 2.
Relates to
apollographql/apollo-client#8236
apollographql/apollo-feature-requests#198
Details
This relates to our work in our web Client to offer a useFragment hook, and there has been some interest in this same level of functionality in iOS.
useFragment
is a read-only reactive/live binding into the cache, providing an always-up-to-date view of whatever data the cache currently contains for a given fragment.It makes sense to want to watch just a fragment but it's not possible in iOS at the moment; it looks like our watcher functions are restricted to queries only.
The text was updated successfully, but these errors were encountered: