aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers/bug.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-04-05 00:25:22 +0200
committerGitHub <noreply@github.com>2019-04-05 00:25:22 +0200
commitb9e413c5f95212a0076aae0f473226b32b5fc77a (patch)
treebe6cf69aad498216fa86058b71e2df9a31ebfbd6 /graphql/resolvers/bug.go
parent5b0a92dea43f467f31a65a6f02e937d285cb0a71 (diff)
parent57f0c2f25da3316efbff63f7f8dc73df20705320 (diff)
downloadgit-bug-b9e413c5f95212a0076aae0f473226b32b5fc77a.tar.gz
Merge pull request #117 from A-Hilaly/bug-participants
Implement participants and actors functionalities
Diffstat (limited to 'graphql/resolvers/bug.go')
-rw-r--r--graphql/resolvers/bug.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/graphql/resolvers/bug.go b/graphql/resolvers/bug.go
index 7af04934..f48ff0a7 100644
--- a/graphql/resolvers/bug.go
+++ b/graphql/resolvers/bug.go
@@ -8,6 +8,7 @@ import (
"github.com/MichaelMure/git-bug/graphql/connections"
"github.com/MichaelMure/git-bug/graphql/graph"
"github.com/MichaelMure/git-bug/graphql/models"
+ "github.com/MichaelMure/git-bug/identity"
)
var _ graph.BugResolver = &bugResolver{}
@@ -102,3 +103,23 @@ func (bugResolver) Timeline(ctx context.Context, obj *bug.Snapshot, after *strin
func (bugResolver) LastEdit(ctx context.Context, obj *bug.Snapshot) (time.Time, error) {
return obj.LastEditTime(), nil
}
+
+func (bugResolver) Actors(ctx context.Context, obj *bug.Snapshot) ([]*identity.Interface, error) {
+ actorsp := make([]*identity.Interface, len(obj.Actors))
+
+ for i, actor := range obj.Actors {
+ actorsp[i] = &actor
+ }
+
+ return actorsp, nil
+}
+
+func (bugResolver) Participants(ctx context.Context, obj *bug.Snapshot) ([]*identity.Interface, error) {
+ participantsp := make([]*identity.Interface, len(obj.Participants))
+
+ for i, participant := range obj.Participants {
+ participantsp[i] = &participant
+ }
+
+ return participantsp, nil
+}