Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions api/export_pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,32 @@ func TestIssue_ExportData(t *testing.T) {
}
`),
},
{
name: "assignees",
fields: []string{"assignees"},
inputJSON: heredoc.Doc(`
{ "assignees": { "nodes": [
{
"id": "MDQ6VXNlcjE=",
"login": "monalisa",
"name": "Mona Lisa",
"databaseId": 1234
}
] } }
`),
outputJSON: heredoc.Doc(`
{
"assignees": [
{
"id": "MDQ6VXNlcjE=",
"login": "monalisa",
"name": "Mona Lisa",
"databaseId": 1234
}
]
}
`),
},
{
name: "linked pull requests",
fields: []string{"closedByPullRequestsReferences"},
Expand Down Expand Up @@ -316,6 +342,32 @@ func TestPullRequest_ExportData(t *testing.T) {
}
`),
},
{
name: "assignees",
fields: []string{"assignees"},
inputJSON: heredoc.Doc(`
{ "assignees": { "nodes": [
{
"id": "MDQ6VXNlcjE=",
"login": "monalisa",
"name": "Mona Lisa",
"databaseId": 1234
}
] } }
`),
outputJSON: heredoc.Doc(`
{
"assignees": [
{
"id": "MDQ6VXNlcjE=",
"login": "monalisa",
"name": "Mona Lisa",
"databaseId": 1234
}
]
}
`),
},
{
name: "linked issues",
fields: []string{"closingIssuesReferences"},
Expand Down
2 changes: 1 addition & 1 deletion api/query_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func IssueGraphQL(fields []string) string {
case "headRepository":
q = append(q, `headRepository{id,name}`)
case "assignees":
q = append(q, `assignees(first:100){nodes{id,login,name},totalCount}`)
q = append(q, `assignees(first:100){nodes{id,login,name,databaseId},totalCount}`)
case "assignedActors":
q = append(q, assignedActors)
case "labels":
Expand Down
4 changes: 2 additions & 2 deletions api/query_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPullRequestGraphQL(t *testing.T) {
{
name: "fields with nested structures",
fields: []string{"author", "assignees"},
want: "author{login,...on User{id,name}},assignees(first:100){nodes{id,login,name},totalCount}",
want: "author{login,...on User{id,name}},assignees(first:100){nodes{id,login,name,databaseId},totalCount}",
},
{
name: "compressed query",
Expand Down Expand Up @@ -67,7 +67,7 @@ func TestIssueGraphQL(t *testing.T) {
{
name: "fields with nested structures",
fields: []string{"author", "assignees"},
want: "author{login,...on User{id,name}},assignees(first:100){nodes{id,login,name},totalCount}",
want: "author{login,...on User{id,name}},assignees(first:100){nodes{id,login,name,databaseId},totalCount}",
},
{
name: "compressed query",
Expand Down
Loading