mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 10:12:06 +03:00
2ab6381a94
Included in the changes: - create a new /api root package to hold all API code, migrate /graphql in there - git API handlers all use the cache instead of the repo directly - git API handlers are now tested - git API handlers now require a "repo" mux parameter - lots of untangling of API/handlers/middleware - less code in commands/webui.go
22 lines
494 B
Go
22 lines
494 B
Go
package resolvers
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/MichaelMure/git-bug/api/graphql/graph"
|
|
"github.com/MichaelMure/git-bug/api/graphql/models"
|
|
)
|
|
|
|
var _ graph.IdentityResolver = &identityResolver{}
|
|
|
|
type identityResolver struct{}
|
|
|
|
func (identityResolver) ID(ctx context.Context, obj models.IdentityWrapper) (string, error) {
|
|
return obj.Id().String(), nil
|
|
}
|
|
|
|
func (r identityResolver) HumanID(ctx context.Context, obj models.IdentityWrapper) (string, error) {
|
|
return obj.Id().Human(), nil
|
|
|
|
}
|