Merge pull request #9007 from babakks/8960-add-projectsV2-field
Add `projectsV2` to JSON fields of `gh repo` commands
This commit is contained in:
commit
f9f4c99010
3 changed files with 7 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ type ProjectV2 struct {
|
|||
Number int `json:"number"`
|
||||
ResourcePath string `json:"resourcePath"`
|
||||
Closed bool `json:"closed"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
// UpdateProjectV2Items uses the addProjectV2ItemById and the deleteProjectV2Item mutations
|
||||
|
|
|
|||
|
|
@ -124,6 +124,9 @@ type Repository struct {
|
|||
Projects struct {
|
||||
Nodes []RepoProject
|
||||
}
|
||||
ProjectsV2 struct {
|
||||
Nodes []ProjectV2
|
||||
}
|
||||
|
||||
// pseudo-field that keeps track of host name of this repo
|
||||
hostname string
|
||||
|
|
|
|||
|
|
@ -442,6 +442,7 @@ var RepositoryFields = []string{
|
|||
"assignableUsers",
|
||||
"mentionableUsers",
|
||||
"projects",
|
||||
"projectsV2",
|
||||
|
||||
// "branchProtectionRules", // too complex to expose
|
||||
// "collaborators", // does it make sense to expose without affiliation filter?
|
||||
|
|
@ -487,6 +488,8 @@ func RepositoryGraphQL(fields []string) string {
|
|||
q = append(q, "mentionableUsers(first:100){nodes{id,login,name}}")
|
||||
case "projects":
|
||||
q = append(q, "projects(first:100,states:OPEN){nodes{id,name,number,body,resourcePath}}")
|
||||
case "projectsV2":
|
||||
q = append(q, "projectsV2(first:100,query:\"is:open\"){nodes{id,number,title,resourcePath,closed,url}}")
|
||||
case "watchers":
|
||||
q = append(q, "watchers{totalCount}")
|
||||
case "issues":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue