Aks HN:为什么 GitHub 的 GraphQL API 返回缺失的数据?
我的网页应用程序依赖于GitHub API。它获取一个GitHub账户的所有关注者和关注对象,然后尝试根据他们的国家进行本地化,以便在地图上显示。问题是,GitHub的GraphQL API在关注部分通常返回一些缺失的数据。我进行了调查,最近也有一些用户报告了一些错误,比如在移动设备上,关注人数会发生变化。在对一些拥有大量关注者的真实案例进行测试后,我也遇到了同样的问题。
我当前的解决方案依赖于REST API来处理缺失的情况:首先我从GraphQL API获取数据,然后快速获取关注列表,接着比较这两者以找出是否有缺失的部分,然后通过REST API恢复这些缺失的数据。
有没有人遇到过这个问题?如果有,你是如何解决的?我问这个是因为我想看看是否有更好的方法,或者你们在使用GitHub API时遇到了什么样的情况,以及你们是如何解决的。
查看原文
My web application relies on the GitHub API. It fetches all the followers/following of a GitHub account and then tries to localize them by their country to show them on a map. The problem is that the gitHub graphQL api returns some missing data (on the following part in general). I investigated, and recently some users also reported some bugs too, like on mobile devices the number of following mutates.
I faced the same issue after testing it against some real cases with large follower counts.
My actual patch relies on the rest api for the missing cases: first I fetch from the graphql apo, then I do a quick fetch for the list of following, and then I compare the two to find out if there is a missing one, then I recover them by the rest api.
Does anyone go through that, and if yes, how did you manage it? I am asking because I want to see if there is a better approach or what kind of cases did you encounter with the gitHub api and how did you solve it