This medical focus often over-rode other important aspects of the consultations, especially existential elements. The doctors were concerned about their patients' health and how their medical knowledge could be of service. Qualitative study in which 101 videotaped consultations were observed and analysed using a Grounded Theory approach, generating explanatory categories through a hermeneutical analysis of the taped consultations.Ī 500-bed general teaching hospital in Norway.ħ1 doctors working in clinical non-psychiatric departments and their patients. Whether you provide options.id explicitly or let writeFragment figure it out using options.data, writeFragment returns a Reference to the identified object.To study how doctors care for their patients, both medically and as fellow humans, through observing their conduct in patient-doctor encounters. If you call writeFragment with an options.data object that the cache is able to identify ( based on its _typename and cache ID field s), you can avoid passing options.id to writeFragment. Example: Updating the cache after a mutation If it isn't, we add the new comment reference to the list of references, returning the full list to be stored in the cache. The writeFragment function returns a reference ( newCommentRef ) that points to the newly cached comment.Īs a safety check, we then scan the array of existing comment references ( existingCommentRefs ) to make sure that our new isn't already in the list. When the comments field modifier function is called, it first calls writeFragment to store our newComment data in the cache. Here's how we might remove a specific Comment from a paginated ments array: Let's say we have a blog application where each Post has an array of Comment s. Examples Example: Removing an item from a list For descriptions of all available utilities, see the API reference. Some of these utilities (namely, the readField function and the DELETE sentinel object) are used in the examples below. Modifier function utilitiesĪ modifier function can optionally take a second parameter, which is an object that contains several helpful utilities. You don't modify the original cached object's data. If you return a different reference in your modifier function, you change which other cached object is contained in this field. Each reference points to its corresponding object in the cache by its cache ID. However, when you define a modifier function for a field that contains an object type or a list of objects, those objects are represented as references. For example, if you define a modifier function for an object's quantity field that has current value 5, your modifier function is passed the value 5. When you define a modifier function for a field that contains a scalar, an enum, or a list of these base types, the modifier function is passed the exact existing value for the field. If you don't provide a modifier function for a particular field, that field 's cached value remains unchanged. Here's an example call to modify that modifies a name field to convert its value to upper case: It takes its associated field 's current cached value as a parameter and returns whatever value should replace it. Optional broadcast and optimistic boolean values to customize behaviorĪ modifier function applies to a single field.A map of modifier functions to execute (one for each field to modify).The ID of a cached object to modify (which we recommend obtaining with cache.identify ).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 field s that do not already exist in the cache.modify circumvents any merge functions you've defined, which means that field s 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 field s (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 field s, or even delete field s 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 |