aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-12 21:03:20 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-12 21:03:20 +0100
commit929480fa0a7fa40ba14850aed17158a20cdf6391 (patch)
tree7bc0579469f936a9378be0b4c95fc149b1df5efe /graphql/resolvers
parentb70b4ba4b17d02d9744bd72494549f5cf7d980f8 (diff)
downloadgit-bug-929480fa0a7fa40ba14850aed17158a20cdf6391.tar.gz
graphql: expose the name of Repository
Diffstat (limited to 'graphql/resolvers')
-rw-r--r--graphql/resolvers/repo.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/graphql/resolvers/repo.go b/graphql/resolvers/repo.go
index 3b0aa9a1..d090544d 100644
--- a/graphql/resolvers/repo.go
+++ b/graphql/resolvers/repo.go
@@ -15,6 +15,11 @@ var _ graph.RepositoryResolver = &repoResolver{}
type repoResolver struct{}
+func (repoResolver) Name(_ context.Context, obj *models.Repository) (*string, error) {
+ name := obj.Repo.Name()
+ return &name, nil
+}
+
func (repoResolver) AllBugs(_ context.Context, obj *models.Repository, after *string, before *string, first *int, last *int, queryStr *string) (*models.BugConnection, error) {
input := models.ConnectionInput{
Before: before,
@@ -153,7 +158,7 @@ func (repoResolver) UserIdentity(_ context.Context, obj *models.Repository) (mod
return models.NewLazyIdentity(obj.Repo, excerpt), nil
}
-func (resolver repoResolver) ValidLabels(_ context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (*models.LabelConnection, error) {
+func (repoResolver) ValidLabels(_ context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (*models.LabelConnection, error) {
input := models.ConnectionInput{
Before: before,
After: after,