graphql-flutter
graphql-flutter copied to clipboard
fetchMore error handling
Basically, with our current implementation of fetchMore
that uses apollo's approach, there is no way for the user to do error handling. In apollo they can .catch
, but I don't think this is good enough - we should just pass both full results to updateQuery
so that the user can handle or merge errors
, etc however they want.
So, instead of just passing the data, we pass the QueryResults and the user checks for errors both?
@mainawycliffe yeah, and maybe have some helper on QueryResult
for merging them, and some sane defaults
Okay, I will work on this over the weekend.
I will work on this tomorrow, am thinking of adding a onError callback with a default method, which merges the GraphQLError list, one can override it to handle errors differently.
@micimize I started working on this and realized there was a PR on having Library level exceptions. Can I work off this PR or should I wait for you to merge it?
@mainawycliffe the docs need to be reworked for lib level exceptions - idk when I'll get around to it
Added a basic mechanism here – https://github.com/micimize/graphql-flutter/tree/fetch_more_errors
I still think the full result merge approach is better though.