-
Notifications
You must be signed in to change notification settings - Fork 55
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
[ApolloPagination] Add completion callbacks to fetch and refetch in GraphQLQueryPager for API Consistency #292
Conversation
👷 Deploy request for apollo-ios-docc pending review.Visit the deploys page to approve it
|
👷 Deploy request for eclectic-pie-88a2ba pending review.Visit the deploys page to approve it
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update the usage docs for this? Maybe we should create a new branch for 0.2 and do this there, so that those docs don't get deployed until we push the 0.2 version release?
We probably should re-generate the docset, yeah. But since this is a non-breaking change, I can see an argument for a 0.1.1. EDIT: 0.2.0 is probably the right move, given that there's a PR up with a breaking change: #299 |
a183b6e
to
3e77136
Compare
…raphQLQueryPager for API Consistency (#292)
…raphQLQueryPager for API Consistency (apollographql/apollo-ios-dev#292)
d8ddfdbc [ApolloPagination] Add completion callbacks to fetch and refetch in GraphQLQueryPager for API Consistency (#292) git-subtree-dir: apollo-ios-pagination git-subtree-split: d8ddfdbc22d8cd1515a7e8288498e1056850d7f8
…etion callbacks to fetch and refetch in GraphQLQueryPager for API Consistency git-subtree-dir: apollo-ios-pagination git-subtree-mainline: e7ee41b git-subtree-split: d8ddfdbc22d8cd1515a7e8288498e1056850d7f8
SopheaSao Cambodia Enjoy with you |
For API consistency, it makes sense that both
fetch
andrefetch
have completion blocks to indicate when their operations are completed. If we think about the way that theAsync
variant works, we always have a "completion" signal in the form of theawait
– whereas we don't forfetch
andrefetch
in theGraphQLQueryPager
.Related: apollographql/apollo-ios#3349
Changes in
GraphQLQueryPager.swift
:public class GraphQLQueryPager<Model>: Publisher {
: Therefetch
andfetch
methods have been updated to include two new parameters:callbackQueue
andcompletion
. This allows users to specify a dispatch queue on which the completion callback should be fired and a completion block that triggers after the operation execution.Changes in
GraphQLQueryPagerCoordinator.swift
:public protocol PagerType {
: Therefetch
andfetch
methods in thePagerType
protocol have been updated to include thecallbackQueue
andcompletion
parameters, aligning with the changes made in theGraphQLQueryPager
class.class GraphQLQueryPagerCoordinator<InitialQuery: GraphQLQuery, PaginatedQuery: G
: Therefetch
andfetch
methods have been updated to include thecallbackQueue
andcompletion
parameters. This allows users to specify a dispatch queue on which the completion callback should be fired and a completion block that triggers after the operation execution. [1] [2]