graphqlhub
graphqlhub copied to clipboard
How does limit work?
In the code:
resolve(repo, { limit }) {
return getIssuesForRepo(repo.owner.login, repo.name).then((issues) => {
if (limit) {
return issues.slice(0, limit);
}
return issues;
});
}
Looks like you ask the api for ALL the issues and then slice? Isn't that too much overload? I'm trying to learn graphql.
Thanks for the repo and the blog posts
Good call, this is broken - it looks like the proper way to deal with getting "all" issues (and/or limiting) is using page and per_page query params (i.e. React's issues)
If you'd like to take a shot at a PR for this, that would be awesome! Exposing Github's underlying API would be a good start (i.e. using page directly) and would fix the current bug, but wrapping these in a Relay-friendly cursor API is where I hope it would get to eventually