Replies: 2 comments
-
btw, when schema is flat
then |
Beta Was this translation helpful? Give feedback.
-
And overview how data looks in in cache.data.links.base Map
and is it bug? |
Beta Was this translation helpful? Give feedback.
-
Hi
Let's have a query, where Model is entity with id and response cursor is next cursor
and after some mutation (delete) I would like to remove deleted entity form items
I can find all cached query by introspection
I am able to readQuery from cache, but can't use updateQuery because data itself has now __typename and updateQuery can handle it.
If I understand documentation correctly I should use resolve and link for that case. But I can't find correct arguments.
cache.resolve('Query', field.fieldKey);
only gives me string 'Query.models({"limit":36})'
which is really used internally by cache.
But how to get list itself. (resolve called with given string returns undefined)
I discovered that items can be obtained and even updated with following snippet
(for simplicity, it just drops first item from cached list)
Set to map also correctly notifies all subscribed queries.
So I get functionality I am looking for, but touching internal cache structures is not a good way to do it.
What is the proper approach?
Beta Was this translation helpful? Give feedback.
All reactions