Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Add GraphQL fields to PullRequests query #170

@danbi2990

Description

@danbi2990

1. Update PullRequests query as follows:

PullRequests Query
query PullRequests(
  $owner: String!
  $name: String!
  $first: Int
  $last: Int
  $before: String
  $after: String
) {
  repository(owner: $owner, name: $name) {
    pullRequests(first: $first, last: $last, before: $before, after: $after) {
      pageInfo {
        hasNextPage
        endCursor
      }
      nodes {
        id
        number
        title
        body
        state
        createdAt
        updatedAt
        closedAt
        mergedAt
        author {
          __typename
          ... on User {
            login
          }
        }
        additions
        deletions
        url
        repository {
          owner {
            __typename
            login
          }
          name
        }
        labels(last: 5) {
          nodes {
            name
          }
        }
        comments(last: 100) {
          totalCount
          nodes {
            body
            createdAt
            updatedAt
            author {
              __typename
              ... on User {
                login
              }
            }
          }
        }
        reviewDecision
        assignees(last: 15) {
          nodes {
            login
          }
        }
        reviewRequests(last: 10) {
          nodes {
            requestedReviewer {
              __typename
              ... on User {
                login
              }
            }
          }
        }
        reviews(last: 10) {
          totalCount
          nodes {
            author {
              __typename
              ... on User {
                login
              }
            }
            state
            body
            url
            createdAt
            publishedAt
            submittedAt
            isMinimized
            comments(last: 100) {
              totalCount
              nodes {
                body
                createdAt
                updatedAt
                author {
                  __typename
                  ... on User {
                    login
                  }
                }
              }
            }
          }
        }
        commits(last: 20) {
          totalCount
          nodes {
            commit {
              additions
              deletions
              message
              messageBody
              author {
                user {
                  login
                }
              }
              changedFilesIfAvailable
              committedDate
              committer {
                user {
                  login
                }
              }
            }
          }
        }
      }
    }
  }
}
This version includes the fields identified in the relevant Notion document. Additional fields may be added later as needed.

2. Add fields to graphql::pull_request::PullRequest struct

To store the retrieved data in the database, the graphql::pull_request::PullRequest struct must be updated. Each field returned by the GraphQL query should be mapped to a corresponding field in the struct.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions