(fields []string)
| 550 | } |
| 551 | |
| 552 | func RepositoryGraphQL(fields []string) string { |
| 553 | var q []string |
| 554 | for _, field := range fields { |
| 555 | switch field { |
| 556 | case "codeOfConduct": |
| 557 | q = append(q, "codeOfConduct{key,name,url}") |
| 558 | case "contactLinks": |
| 559 | q = append(q, "contactLinks{about,name,url}") |
| 560 | case "fundingLinks": |
| 561 | q = append(q, "fundingLinks{platform,url}") |
| 562 | case "licenseInfo": |
| 563 | q = append(q, "licenseInfo{key,name,nickname}") |
| 564 | case "owner": |
| 565 | q = append(q, "owner{id,login}") |
| 566 | case "parent": |
| 567 | q = append(q, "parent{id,name,owner{id,login}}") |
| 568 | case "templateRepository": |
| 569 | q = append(q, "templateRepository{id,name,owner{id,login}}") |
| 570 | case "repositoryTopics": |
| 571 | q = append(q, "repositoryTopics(first:100){nodes{topic{name}}}") |
| 572 | case "issueTemplates": |
| 573 | q = append(q, "issueTemplates{name,title,body,about}") |
| 574 | case "pullRequestTemplates": |
| 575 | q = append(q, "pullRequestTemplates{body,filename}") |
| 576 | case "labels": |
| 577 | q = append(q, "labels(first:100){nodes{id,color,name,description}}") |
| 578 | case "languages": |
| 579 | q = append(q, "languages(first:100){edges{size,node{name}}}") |
| 580 | case "primaryLanguage": |
| 581 | q = append(q, "primaryLanguage{name}") |
| 582 | case "latestRelease": |
| 583 | q = append(q, "latestRelease{publishedAt,tagName,name,url}") |
| 584 | case "milestones": |
| 585 | q = append(q, "milestones(first:100,states:OPEN){nodes{number,title,description,dueOn}}") |
| 586 | case "assignableUsers": |
| 587 | q = append(q, "assignableUsers(first:100){nodes{id,login,name}}") |
| 588 | case "mentionableUsers": |
| 589 | q = append(q, "mentionableUsers(first:100){nodes{id,login,name}}") |
| 590 | case "projects": |
| 591 | q = append(q, "projects(first:100,states:OPEN){nodes{id,name,number,body,resourcePath}}") |
| 592 | case "projectsV2": |
| 593 | q = append(q, "projectsV2(first:100,query:\"is:open\"){nodes{id,number,title,resourcePath,closed,url}}") |
| 594 | case "watchers": |
| 595 | q = append(q, "watchers{totalCount}") |
| 596 | case "issues": |
| 597 | q = append(q, "issues(states:OPEN){totalCount}") |
| 598 | case "pullRequests": |
| 599 | q = append(q, "pullRequests(states:OPEN){totalCount}") |
| 600 | case "defaultBranchRef": |
| 601 | q = append(q, "defaultBranchRef{name}") |
| 602 | default: |
| 603 | q = append(q, field) |
| 604 | } |
| 605 | } |
| 606 | return strings.Join(q, ",") |
| 607 | } |
no test coverage detected