GraphQL API and utilities for the rpdata project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
389 B

  1. package types
  2. import (
  3. "context"
  4. "time"
  5. "git.aiterp.net/rpdata/api/models"
  6. )
  7. type chapterResolver struct{}
  8. func (r *chapterResolver) FictionalDate(ctx context.Context, chapter *models.Chapter) (*time.Time, error) {
  9. if chapter.FictionalDate.IsZero() {
  10. return nil, nil
  11. }
  12. return &chapter.FictionalDate, nil
  13. }
  14. // ChapterResolver is a resolver
  15. var ChapterResolver chapterResolver