Watched queries can control what happens when they're invalidated by updates to the cache, by passing options like fetchPolicy and nextFetchPolicy to client.watchQuery or the useQuery hook.Ĭanonically documented in the API reference, the modify method takes the following parameters:.modify cannot write fields that do not already exist in the cache.modify circumvents any merge functions you've defined, which means that fields are always overwritten with exactly the values you specify.Like writeQuery and writeFragment, modify triggers a refresh of all active queries that depend on modified fields (unless you override this behavior by passing broadcast: false).The modify method of InMemor圜ache enables you to directly modify the values of individual cached fields, or even delete fields entirely. See the full API reference for cache.updateQuery and cache.updateFragment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |