Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 1

apiv4 pullrequests listing broken ordering

Hi,

I have the following query:

{
          repository(owner: "%(org)s", name:"%(repository)s") {
            pullRequests(
              first: %(size)s
              %(after)s
              orderBy: { field: UPDATED_AT, direction: DESC }
            ) {
              totalCount
              pageInfo {
                hasNextPage endCursor
              }
              edges {
                node {
                  updatedAt
                }
              }
            }
          }
        }

After some pages the ordering start to have problem such as:

 

{'data': {'repository': {'pullRequests': {'edges': [{'node': {'updatedAt': '2016-10-25T12:12:18Z'}},
                                                    {'node': {'updatedAt': '2016-10-25T11:25:04Z'}},
                                                    {'node': {'updatedAt': '2016-10-25T11:05:05Z'}},
                                                    {'node': {'updatedAt': '2016-10-25T10:27:50Z'}},
                                                    {'node': {'updatedAt': '2016-10-25T05:39:31Z'}},
                                                    {'node': {'updatedAt': '2016-10-25T05:34:51Z'}},
                                                    {'node': {'updatedAt': '2018-03-07T16:33:29Z'}},
                                                    {'node': {'updatedAt': '2016-10-24T07:18:58Z'}},
                                                    {'node': {'updatedAt': '2016-10-23T21:41:47Z'}},
                                                    {'node': {'updatedAt': '2016-10-23T15:55:32Z'}},
                                                    {'node': {'updatedAt': '2016-10-22T09:39:37Z'}},
                                                    {'node': {'updatedAt': '2016-10-22T08:15:26Z'}},
                                                    {'node': {'updatedAt': '2016-10-21T17:40:25Z'}},
                                                    {'node': {'updatedAt': '2016-10-21T14:58:08Z'}},
                                                    {'node': {'updatedAt': '2016-10-21T13:30:58Z'}},
                                                    {'node': {'updatedAt': '2016-10-21T12:30:25Z'}},
                                                    {'node': {'updatedAt': '2016-10-20T18:28:03Z'}},
                                                    {'node': {'updatedAt': '2016-10-20T16:41:28Z'}},
                                                    {'node': {'updatedAt': '2016-10-19T18:00:42Z'}},
                                                    {'node': {'updatedAt': '2016-10-19T16:12:05Z'}},
                                                    {'node': {'updatedAt': '2016-10-19T15:24:45Z'}},
                                                    {'node': {'updatedAt': '2016-10-19T15:08:34Z'}},
                                                    {'node': {'updatedAt': '2018-05-03T21:03:43Z'}},
                                                    {'node': {'updatedAt': '2016-10-19T12:09:22Z'}},
                                                    {'node': {'updatedAt': '2016-10-19T11:48:08Z'}}],
                                          'pageInfo': {'endCursor': 'Y3Vyc29yOnYyOpK0MjAxNi0xMC0xOVQxMTo0ODowOFrOBVzHKQ==',
                                                       'hasNextPage': True},
                                          'totalCount': 13299}}}}

or even:

 

{'data': {'repository': {'pullRequests': {'edges': [{'node': {'updatedAt': '2017-09-20T17:08:28Z'}},
                                                    {'node': {'updatedAt': '2017-09-20T16:32:45Z'}},
                                                    {'node': {'updatedAt': '2017-09-20T07:19:09Z'}},
                                                    {'node': {'updatedAt': '2017-09-19T14:38:50Z'}},
                                                    {'node': {'updatedAt': '2017-09-19T07:42:12Z'}},
                                                    {'node': {'updatedAt': '2017-09-19T06:26:03Z'}},
                                                    {'node': {'updatedAt': '2017-09-18T19:14:14Z'}},
                                                    {'node': {'updatedAt': '2017-09-18T14:06:39Z'}},
                                                    {'node': {'updatedAt': '2017-09-18T13:37:10Z'}},
                                                    {'node': {'updatedAt': '2017-09-18T09:40:29Z'}},
                                                    {'node': {'updatedAt': '2017-09-16T16:25:30Z'}},
                                                    {'node': {'updatedAt': '2017-09-16T09:24:30Z'}},
                                                    {'node': {'updatedAt': '2017-09-16T07:01:55Z'}},
                                                    {'node': {'updatedAt': '2017-09-16T05:41:38Z'}},
                                                    {'node': {'updatedAt': '2017-09-16T04:05:40Z'}},
                                                    {'node': {'updatedAt': '2017-09-16T04:02:45Z'}},
                                                    {'node': {'updatedAt': '2017-09-15T16:59:31Z'}},
                                                    {'node': {'updatedAt': '2017-09-15T11:15:22Z'}},
                                                    {'node': {'updatedAt': '2017-09-15T11:15:15Z'}},
                                                    {'node': {'updatedAt': '2017-12-25T14:53:52Z'}},
                                                    {'node': {'updatedAt': '2017-10-04T09:50:05Z'}},
                                                    {'node': {'updatedAt': '2017-09-14T17:48:18Z'}},
                                                    {'node': {'updatedAt': '2017-09-14T15:42:49Z'}},
                                                    {'node': {'updatedAt': '2017-09-14T15:09:09Z'}},
                                                    {'node': {'updatedAt': '2017-09-14T13:18:22Z'}}],
                                          'pageInfo': {'endCursor': 'Y3Vyc29yOnYyOpK0MjAxNy0wOS0xNFQxMzoxODoyMlrOCFcPEQ==',
                                                       'hasNextPage': True},
                                          'totalCount': 13299}}}}

How could I mitigate that ? Is it a bug Github API side ?