Company
Date Published
Author
Sashko Stubailo
Word count
1066
Language
English
Hacker News points
None

Summary

Sashko Stubailo explores two potential approaches for caching GraphQL results on the client: storing the whole query result or just objects and fields. Storing the whole query result can reduce data loading, but refetching after mutations and optimistic UI might be challenging. On the other hand, caching objects and fields offers a more flexible solution, allowing for easier integration of new queries and optimistic updates. This approach is similar to Relay's store and Redux's recommendation for normalized stores. The author is working on implementing this concept using a Redux store, aiming to make it easy to understand and use.