|
|
@ -3,6 +3,7 @@ package types |
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"errors" |
|
|
|
"time" |
|
|
|
|
|
|
|
"git.aiterp.net/rpdata/api/internal/loader" |
|
|
|
"git.aiterp.net/rpdata/api/models" |
|
|
@ -28,5 +29,13 @@ func (r *commentResolver) Character(ctx context.Context, obj *models.Comment) (* |
|
|
|
return &character, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (r *commentResolver) FictionalDate(ctx context.Context, obj *models.Comment) (*time.Time, error) { |
|
|
|
if obj.FictionalDate.IsZero() { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
|
|
|
|
return &obj.FictionalDate, nil |
|
|
|
} |
|
|
|
|
|
|
|
// CommentResolver is a resolver
|
|
|
|
var CommentResolver commentResolver |