gr2m / gr2m/github-api-wishlist

GraphQL: Create a generic query node type for pagination

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
7
Forks
1
PR merge metrics
No merged PRs in 30d

Description

GitHub's current GraphQL API supports a generic `query.resource` type:

```js
query {
resource(url:"https://github.com/gr2m/sandbox") {
... on Repository {
nameWithOwner
}
}
}
```

It would be great to have a generic node type that would allow for pagination.

```js
query($cursor: String) {
paginate(first: 100, after: $cursor) {
pageInfo {
endCursor
hasNextPage
}
nodes {
... on Repository {
nameWithOwner
}
}
}
}
```

That would greatly simplify to paginate complex queries with multiple, nested paginations

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.