# https://docs.github.com/en/graphql/reference/objects#pullrequest
fragment pullRequestData on PullRequest {
  __typename
  repository {
    ...repoData   # fragment: repo_frag.graphql
  }
  author {
    ...authorData   # fragment: author_frag.graphql
  }
  number
  title
  url
  bodyText
  createdAt
  updatedAt
  closed
  closedAt
  merged
  mergedAt
  isDraft
  labels(first:10) {
    nodes {
      color
      name
    }
  }
  comments(first: 100) {
    totalCount
    nodes {
      ...commentData    # fragment: comment_frag.graphql
    }
  }
  reviews(first: 100) {
    totalCount
    nodes {
      ...reviewData     # fragment: review_frag.graphql
    }
  }
  reviewThreads(first: 100) {
    # https://docs.github.com/en/graphql/reference/objects#pullrequestreviewthread
    totalCount
    nodes {
      isResolved
      comments(first: 100) {
        totalCount
        nodes {
          pullRequestReview {
            id
          }
          ...commentData    # fragment: comment_frag.graphql
        }
      }
    }
  }
}
