Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination: support cache policy for initial fetch #3418

Closed
pondorasti opened this issue Jul 27, 2024 · 1 comment · Fixed by apollographql/apollo-ios-dev#444
Closed

Pagination: support cache policy for initial fetch #3418

pondorasti opened this issue Jul 27, 2024 · 1 comment · Fixed by apollographql/apollo-ios-dev#444
Labels
feature New addition or enhancement to existing solutions

Comments

@pondorasti
Copy link

pondorasti commented Jul 27, 2024

Use case

I would like to be able to leverage the normalized cache when using AsyncGraphQLQueryPager and pull data from cache without triggering a new fetch request.

Describe the solution you'd like

The private implementation of fetch as part of the AsyncGraphQLQueryPager already supports setting cachePolicy. I would like the same functionality to be extended to the public version of fetch:

-  func fetch() async {
+  func fetch(cachePolicy: CachePolicy = .returnCacheDataAndFetch) async {
    reset()
    await fetch(cachePolicy: cachePolicy)
  }
Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New addition or enhancement to existing solutions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant