New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for automatic GraphQL unpagination #68

Merged
merged 1 commit into from Sep 11, 2018

Conversation

1 participant
@tarsius
Member

tarsius commented Sep 11, 2018

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

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

@tarsius tarsius merged commit 3705935 into master Sep 11, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

tarsius added a commit that referenced this pull request Sep 11, 2018

@tarsius tarsius deleted the graphql branch Sep 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment