Skip to content

Commit

Permalink
fix: queries exceeding number of allowed nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
dlvhdr committed Mar 15, 2024
1 parent 4dc6aae commit d863701
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions data/prapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type PullRequestData struct {
Assignees Assignees `graphql:"assignees(first: 3)"`
Comments Comments `graphql:"comments(last: 5, orderBy: { field: UPDATED_AT, direction: DESC })"`
LatestReviews Reviews `graphql:"latestReviews(last: 3)"`
ReviewThreads ReviewThreads `graphql:"reviewThreads(last: 100)"`
ReviewThreads ReviewThreads `graphql:"reviewThreads(last: 20)"`
IsDraft bool
Commits Commits `graphql:"commits(last: 1)"`
}
Expand Down Expand Up @@ -138,7 +138,7 @@ type ReviewThreads struct {
StartLine int
Line int
Path string
Comments ReviewComments `graphql:"comments(first: 100)"`
Comments ReviewComments `graphql:"comments(first: 10)"`
}
}

Expand Down Expand Up @@ -204,9 +204,10 @@ func FetchPullRequests(query string, limit int, pageInfo *PageInfo) (PullRequest
"limit": graphql.Int(limit),
"endCursor": (*graphql.String)(endCursor),
}
log.Debug("Fetching PRs", "query", query, "limit", limit, "endCursor", endCursor)
log.Debug("Fetching PRs", "query", query, "limit", limit, "endCursor", endCursor, "queryResult", queryResult)
err = client.Query("SearchPullRequests", &queryResult, variables)
if err != nil {
log.Error("Failed fetching PRs", "query", query, "error", err)
return PullRequestsResponse{}, err
}
log.Debug("Successfully fetched PRs", "query", query, "count", queryResult.Search.IssueCount)
Expand Down

0 comments on commit d863701

Please sign in to comment.