writeFragment abstract method

void writeFragment(
  1. FragmentRequest fragmentRequest, {
  2. required Map<String, dynamic> data,
  3. bool? broadcast,
})

Writes a GraphQL fragment to any arbitrary id. then broadcast changes to watchers unless broadcast: false

If there is more than one fragment in the provided document then a fragmentName must be provided to fragmentRequest.fragment to select the correct fragment.

For complex normalize type policies that involve custom reads, optimistic will be the default.

Will throw a PartialDataException if the data structure doesn't match that of the fragmentRequest fragment.document, or a CacheMisconfigurationException if the write fails for some other reason.

Implementation

void writeFragment(
  FragmentRequest fragmentRequest, {
  required Map<String, dynamic> data,
  bool? broadcast,
});