graphql-flutter
graphql-flutter copied to clipboard
Allow fetchPolicy of cacheFirst in fetchMore
Is your feature request related to a problem? Please describe.
When calling fetchMore, it always uses the network without the cache:
Describe the solution you'd like
I would like to overwrite this to use a different FetchPolicy of cacheFirst
.
My use case for this is that I have a huge list which rarely changes, and when you navigate to another page and then back to this list, it always fetches it from the server again and again, while it could just as well show it from the cache.
I understand this may have some internal cache update implications but I think it's worth to think about this for this use-case.
Describe alternatives you've considered
Additional context
https://github.com/zino-app/graphql-flutter/blob/5bde247c52a58e3bef93989378d1d3ec2559d7e0/packages/graphql/lib/src/core/fetch_more.dart#L33
related issue: #372