Aks HN:为什么 GitHub GraphQL API 返回的数据不完整?

1 分•作者: ThierryRkt•3 个月前
我的 Web 应用程序依赖于 GitHub API。它会获取一个 GitHub 账户的所有关注者/正在关注的用户,然后尝试根据国家/地区对他们进行本地化,以便在地图上显示。问题在于 GitHub GraphQL API 返回了一些缺失的数据(通常是在“正在关注”的部分)。我进行了调查,最近一些用户也报告了一些 bug,例如在移动设备上,“正在关注”的数量会发生变化。 在用一些真实的大量关注者数量的案例进行测试后,我也遇到了同样的问题。 我目前的补丁在缺失的情况下依赖于 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