Skip to content

Commit

Permalink
Order projects, teams, and labels by name
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed May 8, 2020
1 parent 1f774b4 commit d7e6d21
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/queries_org.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func OrganizationProjects(client *Client, owner string) ([]RepoProject, error) {
HasNextPage bool
EndCursor string
}
} `graphql:"projects(states: [OPEN], first: 100, after: $endCursor)"`
} `graphql:"projects(states: [OPEN], first: 100, orderBy: {field: NAME, direction: ASC}, after: $endCursor)"`
} `graphql:"organization(login: $owner)"`
}

Expand Down Expand Up @@ -81,7 +81,7 @@ func OrganizationTeams(client *Client, owner string) ([]OrgTeam, error) {
HasNextPage bool
EndCursor string
}
} `graphql:"teams(first: 100, after: $endCursor)"`
} `graphql:"teams(first: 100, orderBy: {field: NAME, direction: ASC}, after: $endCursor)"`
} `graphql:"organization(login: $owner)"`
}

Expand Down
4 changes: 2 additions & 2 deletions api/queries_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ func RepoProjects(client *Client, repo ghrepo.Interface) ([]RepoProject, error)
HasNextPage bool
EndCursor string
}
} `graphql:"projects(states: [OPEN], first: 100, after: $endCursor)"`
} `graphql:"projects(states: [OPEN], first: 100, orderBy: {field: NAME, direction: ASC}, after: $endCursor)"`
} `graphql:"repository(owner: $owner, name: $name)"`
}

Expand Down Expand Up @@ -672,7 +672,7 @@ func RepoLabels(client *Client, repo ghrepo.Interface) ([]RepoLabel, error) {
HasNextPage bool
EndCursor string
}
} `graphql:"labels(first: 100, after: $endCursor)"`
} `graphql:"labels(first: 100, orderBy: {field: NAME, direction: ASC}, after: $endCursor)"`
} `graphql:"repository(owner: $owner, name: $name)"`
}

Expand Down
1 change: 1 addition & 0 deletions command/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ func issueCreate(cmd *cobra.Command, args []string) error {
Milestones: tb.Milestone != "",
}

// TODO: for non-interactive mode, only translate given objects to GraphQL IDs
tb.MetadataResult, err = api.RepoMetadata(apiClient, baseRepo, metadataInput)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions command/pr_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ func prCreate(cmd *cobra.Command, _ []string) error {
Milestones: tb.Milestone != "",
}

// TODO: for non-interactive mode, only translate given objects to GraphQL IDs
tb.MetadataResult, err = api.RepoMetadata(client, baseRepo, metadataInput)
if err != nil {
return err
Expand Down

0 comments on commit d7e6d21

Please sign in to comment.