diff options
author | Luke Granger-Brown <git@lukegb.com> | 2020-06-19 00:26:47 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-06-27 23:01:09 +0200 |
commit | e5a316e40c377a8563e92f62b0773ed34321a91a (patch) | |
tree | 4788a8135201a1d3c0f05014ff1c8c2ca4060c57 /graphql/resolvers/repo.go | |
parent | 766aff2b2f9db339d7c42321fe6cd37309631be3 (diff) | |
download | git-bug-e5a316e40c377a8563e92f62b0773ed34321a91a.tar.gz git-bug-e5a316e40c377a8563e92f62b0773ed34321a91a.zip |
Pull out context-stuff from identity into graphqlidentity package
Diffstat (limited to 'graphql/resolvers/repo.go')
-rw-r--r-- | graphql/resolvers/repo.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/graphql/resolvers/repo.go b/graphql/resolvers/repo.go index ded98636..f68ed3e0 100644 --- a/graphql/resolvers/repo.go +++ b/graphql/resolvers/repo.go @@ -7,8 +7,8 @@ import ( "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/graphql/connections" "github.com/MichaelMure/git-bug/graphql/graph" + "github.com/MichaelMure/git-bug/graphql/graphqlidentity" "github.com/MichaelMure/git-bug/graphql/models" - "github.com/MichaelMure/git-bug/identity" "github.com/MichaelMure/git-bug/query" ) @@ -151,11 +151,13 @@ func (repoResolver) Identity(_ context.Context, obj *models.Repository, prefix s } func (repoResolver) UserIdentity(ctx context.Context, obj *models.Repository) (models.IdentityWrapper, error) { - id := identity.ForContext(ctx, obj.Repo) - if id == nil { + id, err := graphqlidentity.ForContext(ctx, obj.Repo) + if err != nil { + return nil, err + } else if id == nil { return nil, nil } - return models.NewLoadedIdentity(id), nil + return models.NewLoadedIdentity(id.Identity), nil } func (repoResolver) ValidLabels(_ context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (*models.LabelConnection, error) { |