Add CreatedAt & UpdatedAt to all object resolvers (#1421)

* add `CreatedAt` & `UpdatedAt` to all objects
* add `FileModTime` to supported objects
* Use `GQL.SlimTagDataFragment` over `GQL.Tag`
This commit is contained in:
peolic
2021-05-25 03:56:34 +03:00
committed by GitHub
parent 3981a781b9
commit d326d4380f
21 changed files with 109 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package api
import (
"context"
"time"
"github.com/stashapp/stash/pkg/image"
"github.com/stashapp/stash/pkg/models"
@@ -153,3 +154,15 @@ func (r *galleryResolver) ImageCount(ctx context.Context, obj *models.Gallery) (
return ret, nil
}
func (r *galleryResolver) CreatedAt(ctx context.Context, obj *models.Gallery) (*time.Time, error) {
return &obj.CreatedAt.Timestamp, nil
}
func (r *galleryResolver) UpdatedAt(ctx context.Context, obj *models.Gallery) (*time.Time, error) {
return &obj.UpdatedAt.Timestamp, nil
}
func (r *galleryResolver) FileModTime(ctx context.Context, obj *models.Gallery) (*time.Time, error) {
return &obj.FileModTime.Timestamp, nil
}