Skip to content

Clarify how itemTypes affects PullRequestTimelineItemsConnection counts #47100

Backlog

Description

@nick-inkeep

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/graphql/reference/pulls#object-pullrequesttimelineitemsconnection

What part(s) of the article would you like to see updated?

When fetching commits and comments from a pull request timeline, we need to know how many selected items to expect. The reference describes totalCount as the connection's item count, but it includes event types excluded by itemTypes in the example below. In that result, filteredCount and pageCount both return 1, matching the single selected item. Neither description mentions item-type filtering.

Could you clarify which counts apply itemTypes filtering and what totalCount represents when that argument is set?

Additional information

Reproduced on GitHub.com GraphQL API on November 27, 2026, against public octocat/Spoon-Knife#42474.

gh api graphql -f query='{
  repository(owner:"octocat", name:"Spoon-Knife") {
    pullRequest(number:42474) {
      unfiltered: timelineItems(first:100) {
        totalCount filteredCount pageCount
        nodes { __typename }
        pageInfo { hasNextPage }
      }
      filtered: timelineItems(first:100, itemTypes:[PULL_REQUEST_COMMIT, ISSUE_COMMENT]) {
        totalCount filteredCount pageCount
        nodes { __typename }
        pageInfo { hasNextPage }
      }
    }
  }
}'
totalCount filteredCount pageCount nodes hasNextPage
Unfiltered 2 2 2 2 (commit, closed event) false
Filtered 2 1 1 1 (commit) false

For comparison, querying Issue.timelineItems on cli/cli#6508 with itemTypes:[ISSUE_COMMENT] reduces totalCount from 6 to 2, matching the two returned comments. Both connections use the same wording for totalCount.

Live schema introspection and current main's schema source have the same descriptions.

Activity

  1. added
    triage
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions