Graphql commitsWithoutMergeCommits's pageInfo returns hasNextPage is False if there are more than 100 commits
Given a query such as the following to list all of the commits of an MR:
{
"namespace": "redhat/rhel/src/kernel/kernel-test",
"mr_id": "379",
"cursor": ""
}
query mrData($mr_id: String!, $namespace: ID!, $cursor: String!) {
project(fullPath: $namespace) {
mergeRequest(iid: $mr_id) {
commitCount
commits: commitsWithoutMergeCommits(after: $cursor) {
pageInfo {
hasNextPage
endCursor
}
nodes {
shortId
}
}
}
}
}
# Results:
{
"data": {
"project": {
"mergeRequest": {
"commitCount": 360,
"commits": {
"pageInfo": {
"hasNextPage": false,
"endCursor": "MTAw"
},
"nodes": [
{
"shortId": "b77dc4e6"
},
{
"shortId": "0cc8bdc0"
},
{
"shortId": "df41baf1"
},
{
"shortId": "5601e196"
},
{
"shortId": "7d672e6b"
},
{
"shortId": "516eb3e9"
},
{
"shortId": "8073c560"
},
{
"shortId": "0f34276d"
},
{
"shortId": "a3c5d1f1"
},
{
"shortId": "66df869b"
},
{
"shortId": "c64b62a1"
},
{
"shortId": "38b249b0"
},
{
"shortId": "d25e33c6"
},
{
"shortId": "b98edc24"
},
{
"shortId": "62554380"
},
{
"shortId": "ad8c8f9e"
},
{
"shortId": "0620a67b"
},
{
"shortId": "97643781"
},
{
"shortId": "faf2e7e7"
},
{
"shortId": "732a6564"
},
{
"shortId": "d010a897"
},
{
"shortId": "50de025e"
},
{
"shortId": "a8de4df7"
},
{
"shortId": "3a13b37c"
},
{
"shortId": "a8865c22"
},
{
"shortId": "06199467"
},
{
"shortId": "c9ccaba8"
},
{
"shortId": "4cefa805"
},
{
"shortId": "9e04a906"
},
{
"shortId": "e4592c88"
},
{
"shortId": "56c7667a"
},
{
"shortId": "cd0f159e"
},
{
"shortId": "1a9f9959"
},
{
"shortId": "91ddfecf"
},
{
"shortId": "74e7a81f"
},
{
"shortId": "89f7cdef"
},
{
"shortId": "a2be1c0b"
},
{
"shortId": "1b4bdb7f"
},
{
"shortId": "516c1068"
},
{
"shortId": "3e07d982"
},
{
"shortId": "2d7556ca"
},
{
"shortId": "ec8900dd"
},
{
"shortId": "bb5700c3"
},
{
"shortId": "617ced1a"
},
{
"shortId": "e6f36e1a"
},
{
"shortId": "e1e98183"
},
{
"shortId": "9e396138"
},
{
"shortId": "02d891bf"
},
{
"shortId": "08231d7d"
},
{
"shortId": "e4479ebb"
},
{
"shortId": "e6f8a512"
},
{
"shortId": "7a941b33"
},
{
"shortId": "546319e9"
},
{
"shortId": "e740324b"
},
{
"shortId": "bf4eba95"
},
{
"shortId": "38ef46ea"
},
{
"shortId": "ad6cd5fd"
},
{
"shortId": "78d6068e"
},
{
"shortId": "c7c359b9"
},
{
"shortId": "ae55a837"
},
{
"shortId": "c0eace80"
},
{
"shortId": "1d4e9908"
},
{
"shortId": "96f5c46e"
},
{
"shortId": "a0aab3ef"
},
{
"shortId": "93a712e7"
},
{
"shortId": "389648e4"
},
{
"shortId": "74ece877"
},
{
"shortId": "e807c7c3"
},
{
"shortId": "4061dfcf"
},
{
"shortId": "29a372a8"
},
{
"shortId": "41256a5d"
},
{
"shortId": "e986195a"
},
{
"shortId": "82660e8b"
},
{
"shortId": "f7a10bc4"
},
{
"shortId": "99e5598a"
},
{
"shortId": "9f594d1e"
},
{
"shortId": "547f7644"
},
{
"shortId": "19833547"
},
{
"shortId": "c704b201"
},
{
"shortId": "bbdbda6f"
},
{
"shortId": "9d33ba42"
},
{
"shortId": "46b0049f"
},
{
"shortId": "39fdcba8"
},
{
"shortId": "ee7c20fb"
},
{
"shortId": "adad2ebe"
},
{
"shortId": "6642af97"
},
{
"shortId": "63b815f2"
},
{
"shortId": "3d86129c"
},
{
"shortId": "a54a1973"
},
{
"shortId": "1307a21d"
},
{
"shortId": "eb8c9fa7"
},
{
"shortId": "815e6831"
},
{
"shortId": "56a076d6"
},
{
"shortId": "364d6c44"
},
{
"shortId": "82cb69c5"
},
{
"shortId": "074e9274"
},
{
"shortId": "4d347211"
},
{
"shortId": "1076de6d"
},
{
"shortId": "a072a406"
},
{
"shortId": "5ca59cfa"
}
]
}
}
}
}
}
Note it shows the correct commitCount of 360. The commitsWithoutMergeCommits node list contains the first 100 items but the pageInfo hasNextPage is False. It should be True.
If you pass the given endCursor "MTAw" then the node list is empty.
{
"namespace": "redhat/rhel/src/kernel/kernel-test",
"mr_id": "379",
"cursor": "MTAw"
}
# Results:
{
"data": {
"project": {
"mergeRequest": {
"commitCount": 360,
"commits": {
"pageInfo": {
"hasNextPage": false,
"endCursor": null
},
"nodes": []
}
}
}
}
}