diff options
author | Michael Muré <batolettre@gmail.com> | 2024-08-28 11:43:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-28 09:43:42 +0000 |
commit | 57e7147021e38b847213d4dc7f0e0bf0b022850d (patch) | |
tree | 882650697950003e2325f0815353032a8596ca1d /api/graphql/resolvers/timeline.go | |
parent | e45c3c5ee6dc5650fd8c3f480d9e09e5f3b221fd (diff) | |
download | git-bug-57e7147021e38b847213d4dc7f0e0bf0b022850d.tar.gz |
graphql: properly namespace Bug to make space for other entities (#1254)
Also: use gqlgen directives to help the type auto-binding
Missing:
- namespace mutations
- adapt the webUI queries
Diffstat (limited to 'api/graphql/resolvers/timeline.go')
-rw-r--r-- | api/graphql/resolvers/timeline.go | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/api/graphql/resolvers/timeline.go b/api/graphql/resolvers/timeline.go deleted file mode 100644 index b710c32c..00000000 --- a/api/graphql/resolvers/timeline.go +++ /dev/null @@ -1,115 +0,0 @@ -package resolvers - -import ( - "context" - "time" - - "github.com/git-bug/git-bug/api/graphql/graph" - "github.com/git-bug/git-bug/api/graphql/models" - "github.com/git-bug/git-bug/entities/bug" - "github.com/git-bug/git-bug/entity" -) - -var _ graph.CommentHistoryStepResolver = commentHistoryStepResolver{} - -type commentHistoryStepResolver struct{} - -func (commentHistoryStepResolver) Date(_ context.Context, obj *bug.CommentHistoryStep) (*time.Time, error) { - t := obj.UnixTime.Time() - return &t, nil -} - -var _ graph.AddCommentTimelineItemResolver = addCommentTimelineItemResolver{} - -type addCommentTimelineItemResolver struct{} - -func (addCommentTimelineItemResolver) ID(_ context.Context, obj *bug.AddCommentTimelineItem) (entity.CombinedId, error) { - return obj.CombinedId(), nil -} - -func (addCommentTimelineItemResolver) Author(_ context.Context, obj *bug.AddCommentTimelineItem) (models.IdentityWrapper, error) { - return models.NewLoadedIdentity(obj.Author), nil -} - -func (addCommentTimelineItemResolver) CreatedAt(_ context.Context, obj *bug.AddCommentTimelineItem) (*time.Time, error) { - t := obj.CreatedAt.Time() - return &t, nil -} - -func (addCommentTimelineItemResolver) LastEdit(_ context.Context, obj *bug.AddCommentTimelineItem) (*time.Time, error) { - t := obj.LastEdit.Time() - return &t, nil -} - -var _ graph.CreateTimelineItemResolver = createTimelineItemResolver{} - -type createTimelineItemResolver struct{} - -func (createTimelineItemResolver) ID(_ context.Context, obj *bug.CreateTimelineItem) (entity.CombinedId, error) { - return obj.CombinedId(), nil -} - -func (r createTimelineItemResolver) Author(_ context.Context, obj *bug.CreateTimelineItem) (models.IdentityWrapper, error) { - return models.NewLoadedIdentity(obj.Author), nil -} - -func (createTimelineItemResolver) CreatedAt(_ context.Context, obj *bug.CreateTimelineItem) (*time.Time, error) { - t := obj.CreatedAt.Time() - return &t, nil -} - -func (createTimelineItemResolver) LastEdit(_ context.Context, obj *bug.CreateTimelineItem) (*time.Time, error) { - t := obj.LastEdit.Time() - return &t, nil -} - -var _ graph.LabelChangeTimelineItemResolver = labelChangeTimelineItem{} - -type labelChangeTimelineItem struct{} - -func (labelChangeTimelineItem) ID(_ context.Context, obj *bug.LabelChangeTimelineItem) (entity.CombinedId, error) { - return obj.CombinedId(), nil -} - -func (i labelChangeTimelineItem) Author(_ context.Context, obj *bug.LabelChangeTimelineItem) (models.IdentityWrapper, error) { - return models.NewLoadedIdentity(obj.Author), nil -} - -func (labelChangeTimelineItem) Date(_ context.Context, obj *bug.LabelChangeTimelineItem) (*time.Time, error) { - t := obj.UnixTime.Time() - return &t, nil -} - -var _ graph.SetStatusTimelineItemResolver = setStatusTimelineItem{} - -type setStatusTimelineItem struct{} - -func (setStatusTimelineItem) ID(_ context.Context, obj *bug.SetStatusTimelineItem) (entity.CombinedId, error) { - return obj.CombinedId(), nil -} - -func (i setStatusTimelineItem) Author(_ context.Context, obj *bug.SetStatusTimelineItem) (models.IdentityWrapper, error) { - return models.NewLoadedIdentity(obj.Author), nil -} - -func (setStatusTimelineItem) Date(_ context.Context, obj *bug.SetStatusTimelineItem) (*time.Time, error) { - t := obj.UnixTime.Time() - return &t, nil -} - -var _ graph.SetTitleTimelineItemResolver = setTitleTimelineItem{} - -type setTitleTimelineItem struct{} - -func (setTitleTimelineItem) ID(_ context.Context, obj *bug.SetTitleTimelineItem) (entity.CombinedId, error) { - return obj.CombinedId(), nil -} - -func (i setTitleTimelineItem) Author(_ context.Context, obj *bug.SetTitleTimelineItem) (models.IdentityWrapper, error) { - return models.NewLoadedIdentity(obj.Author), nil -} - -func (setTitleTimelineItem) Date(_ context.Context, obj *bug.SetTitleTimelineItem) (*time.Time, error) { - t := obj.UnixTime.Time() - return &t, nil -} |