Merge pull request #12783 from srt32/fix-assignee-databaseid
Add databaseId to assignees GraphQL fragment
This commit is contained in:
commit
097bad6f73
3 changed files with 55 additions and 3 deletions
|
|
@ -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"},
|
||||
|
|
@ -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"},
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue