Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add support for automatic GraphQL unpagination
GraphQL was designed around the idea that you should be able to "ask for what you need and get exactly that". Unfortunately this does not cover the "look, if I persist, then you are going to hand me over all the data anyway, so just caught it up already", which is what Forge needs. `ghub--graphql-vacuum' provides a way to unpaginate all cursors in the returned data without having to write a lot of boilerplate. Callers have to provide the query as an s-expression that corresponds to the root request. The queries needed to follow cursors in arbitrary locations within the returned data, are automatically derived from that query. `ghub-fetch-repository' fetches information about a repository. If also serves as an example for how to use `ghub--graphql-vacuum'. The initial queries used by `ghub-fetch-issue' and `ghub-fetch-pullreq' are pre-narrowed variants of the initial query of `ghub-fetch-repository'. Pre-narrowing is somewhat similar to the use of fragments, but unlike that, it doesn't result in lots of duplicated boilerplate and/or lots of variables. There is very little documentation and everything is still very much subject to change
- Loading branch information