Company
Date Published
Author
Ben Newman
Word count
1687
Language
English
Hacker News points
None

Summary

Apollo Client 2.6 is a backwards-compatible update that fixes bugs and provides new options for rendering components faster and more smoothly, including `assumeImmutableResults`, `freezeResults`, and `returnPartialData`. The new `assumeImmutableResults` option allows the client to avoid recording defensive snapshots of past results if the application code does not modify cache result objects. Passing `freezeResults: true` to the `InMemoryCache` constructor causes all cache results to be frozen in development, making it easier to detect accidental mutations. The return of `returnPartialData` allows consumers to opt into receiving partial results from the cache for queries not fully satisfied by the cache. Future versions of Apollo Client aim to consolidate and simplify the API while paving the way for new features such as async iterators, unified query API, cache normalization, and immutability of cache results becoming the default. The updated API is designed to make it easier for developers to manage local state and improve performance.