From 929480fa0a7fa40ba14850aed17158a20cdf6391 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 12 Feb 2020 21:03:20 +0100 Subject: graphql: expose the name of Repository --- graphql/resolvers/repo.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'graphql/resolvers/repo.go') 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, -- cgit