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