Graphql API query tags doesn't work as expected

I got two issues when using graphql API to query tags of a specific repo.

  • The cursor of node in the response is not consistent. For the same node, the cursors returned are not always the same.
  • The order of the records returned is incorrect . I used ‘TAG_COMMIT_DATE’ as orderBy field, but the tags returned are not sorted by the committedDate

Here is my query

query {
  repository (owner: "vitejs", name: "vite") {
    refs(refPrefix: "refs/tags/", first: 20, orderBy: {field: TAG_COMMIT_DATE, direction: DESC}) {
      edges {
        cursor
        node {
          name
          target {
            ... on Tag {
              name
            }
            ... on Commit {
            	message
              committedDate
            }
          }
        }
      }
    }
  }
}

Anything wrong in my query? I composed the similar query for releases, it works as expected.