apollo-feature-requests
apollo-feature-requests copied to clipboard
Revisit `refetchQueries` API
The refetchQueries API used primarily to refetch data after a mutation is a bit unintuitive in its current form. We've had quite a few questions about this feature where people misunderstand how it works.
The key part of this API primarily misunderstood is that refetchQueries only refetches active queries, which are queries that are currently mounted on screen. Once a query has been unmounted/unsubscribed, it will no longer be refetched. This presents a lot of confusion when devs think a bug exists because they don't see the network request after the mutation.
As such, I'd like to revisit this API in future major and see what we can do to improve this to make the behavior more intuitive.