John O'Reilly
12/21/2021, 11:53 AMwatch
with endpoint that supports paging?bod
12/21/2021, 1:19 PMJohn O'Reilly
12/21/2021, 1:28 PMwatch
bod
12/21/2021, 1:51 PMJohn O'Reilly
12/21/2021, 2:14 PMwatch
in this case....the data associated with particular page you queried....or the list contain all data retrieved so far?watch
in this case doesn't make sense....if using Android paging library for example (coupled with use of Compose's collectAsLazyPagingItems
) then would just use function that queries for particular page of data (which I guess would come from cache if it was in it?)bod
12/21/2021, 4:03 PMPaul Davies
01/06/2022, 12:32 PMitems
, like so…
query ItemsQuery($itemArgs: ItemArgs!) {
items(args: $itemArgs) {
edges {
id
node
}
pageInfo
}
}
type ItemsArgs {
first: Float
after: String
last: Float
before: String
filterBy: ItemsFilterByArgs
}
where the pageInfo
contains the pagination info, and ItemsArgs
allows us to request a “bucket” of data (usually a month of time’s worth).
The use case is for us to regularly sync our items from the server to the normalised cache, and our UI will watch the cache.
It seems the only way for us to do this is to iterate over the pages in the query, and manually writeOperation
the cache to populate it with all the edges
(and key it against the original query with no pagination parameter).
Unless there is something I’m missing?bod
01/06/2022, 12:51 PM