Improve query variable names

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
This commit is contained in:
Babak K. Shandiz 2024-05-07 00:19:30 +01:00
parent 81df8638cb
commit cec2ced42f
No known key found for this signature in database
GPG key ID: 44950AED81AD710F

View file

@ -716,11 +716,11 @@ type RefComparison struct {
} }
func ComparePullRequestBaseBranchWith(client *Client, repo ghrepo.Interface, prNumber int, headRef string) (*RefComparison, error) { func ComparePullRequestBaseBranchWith(client *Client, repo ghrepo.Interface, prNumber int, headRef string) (*RefComparison, error) {
query := `query ComparePullRequestBaseBranchWith($owner: String!, $repo: String!, $pr_number: Int!, $head_ref: String!) { query := `query ComparePullRequestBaseBranchWith($owner: String!, $repo: String!, $pr_number: Int!, $headRef: String!) {
repository(owner: $owner, name: $repo) { repository(owner: $owner, name: $repo) {
pullRequest(number: $pr_number) { pullRequest(number: $pullRequestNumber) {
baseRef { baseRef {
compare (headRef: $head_ref) { compare (headRef: $headRef) {
aheadBy, behindBy, status aheadBy, behindBy, status
} }
} }
@ -738,10 +738,10 @@ func ComparePullRequestBaseBranchWith(client *Client, repo ghrepo.Interface, prN
} }
} }
variables := map[string]interface{}{ variables := map[string]interface{}{
"owner": repo.RepoOwner(), "owner": repo.RepoOwner(),
"repo": repo.RepoName(), "repo": repo.RepoName(),
"pr_number": prNumber, "pullRequestNumber": prNumber,
"head_ref": headRef, "headRef": headRef,
} }
if err := client.GraphQL(repo.RepoHost(), query, variables, &result); err != nil { if err := client.GraphQL(repo.RepoHost(), query, variables, &result); err != nil {