magit / ghub

Client libraries for the APIs of various Git forges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support unpaginating when using aliases

tarsius opened this issue · comments

Automatic unpagination involves the following (in this we are unpaginating comments on an issue):

query:    (query (repository ... (issue ...)))
response: (data (repository (issue ...)))
lineage:  (repository issue comments)

The lineage allows us to narrow the query to what is needed to fetch paginated comments.

This breaks when the response data is not symmetric to the structure of the request. Unfortunately this is the case when aliases are involved (the repository is missing).

query:    (query (somealias [(:alias t)] (repository ... (issue ...))))
response: (data (somealias (issue ...)))
lineage:  (somealias issue comments)

I have made some progress locating some places where we have to detect that aliases are involved, but I have not yet figured where what data has to modified how, in order to restore symmetry.

The error Field 'nil' doesn't exist on type 'Query' when fetching Github notifications using Forge is a symptom if this. Most likely because an issue with more than a hundred comments is involved.

Unfortunately simply not unpaginating until we have a better solution would also be difficult to do.

This breaks when the response data is not symmetric to the structure of the request. Unfortunately this is the case when aliases are involved (the repository is missing).

But that's not a defect of GraphQl itself, but of ghub-graphql.el.