Pagination
All list responses from queries return paginated results. We implement Relay style cursor-based pagination model with first/after and last/before pagination arguments. To simply query get first 10 issues for your organization:
1
query Issues {
2
issues(first: 10) {
3
edges {
4
node {
5
id
6
title
7
}
8
cursor
9
}
10
pageInfo {
11
hasNextPage
12
endCursor
13
}
14
}
15
}
Copied!
To query the next 10, simply pass the value of pageInfo.endCursor as after parameter for the next request. You can do this as long as pageInfo.hasNextPage return true and you'll paginate through all the values in the collection.
The first 50 results are returned by default without query arguments. Pagination also supports simpler syntax where instead of edges you can directly get all the nodes similar to GitHub's GraphQL API:
1
query Teams {
2
teams {
3
nodes {
4
id
5
name
6
}
7
}
8
}
Copied!
By default results are ordered by createdAt field. To get most recently updated resources, you can alternatively order by updatedAt field:
1
query Issues {
2
issues(orderBy: updatedAt) {
3
nodes {
4
id
5
identifier
6
title
7
createdAt
8
updatedAt
9
}
10
}
11
}
Copied!
Last modified 1mo ago
Copy link