Closed pixelmatrix closed 1 month ago
@pixelmatrix thanks for reporting! I'll take a look at this one today.
To summarize the issue:
data
or contains errors
.errors
(of type GraphQLError
) aren't considered or surfaced to the user, meaning that we don't surface the partial-success case well. data
is assumed to be present always.The net effect of this is we aren't surfacing errors
from the server with 200OK responses. There's some thought that's going to have to be made about how we would want to handle partial success – as well as multiple errors. At present, our failure
case only takes one error. Similarly, I don't think that our binary success/failure cases cleanly map to a partial success.
Related to this, it seems if there is a 200 OK failure when another page is loading via loadAll()
it causes the pager to retry that page over and over again.
Related to this, it seems if there is a 200 OK failure when another page is loading via
loadAll()
it causes the pager to retry that page over and over again.
That should also be handled by https://github.com/apollographql/apollo-ios-dev/pull/428 – thank you for reporting.
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.
Summary
I'm using an instance of
AsyncGraphQLQueryPager
to fetch some data. As I was testing today I had a problem where the subscribe callback was not being called. After looking into it, the first page query actually failed to load.It looks like the
onFetch
method switches over theResult<GraphQLResult<DataType>, Error>
to check for errors, but inside theSuccess
case, it assumes there will always be data:https://github.com/apollographql/apollo-ios-pagination/blob/main/Sources/ApolloPagination/AsyncGraphQLQueryPagerCoordinator.swift#L302
In my case,
data.data
isnil
, anddata.errors
contains an error from the server. Instead, I was expecting that the subscriber would be called with an error.Version
0.1.0
Steps to reproduce the behavior
subscriber
to print the resultsfetch()
on the pagersubscriber
closure is never calledLogs
No response
Anything else?
No response