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.

50 lines
1.1 KiB

  1. package types
  2. import (
  3. "time"
  4. "git.aiterp.net/rpdata/api/model/story"
  5. )
  6. // ChapterResolver for the Chapter graphql type
  7. type ChapterResolver struct{ C story.Chapter }
  8. // ID resolves Chapter.id
  9. func (r *ChapterResolver) ID() string {
  10. return r.C.ID
  11. }
  12. // StoryID resolves Chapter.storyId
  13. func (r *ChapterResolver) StoryID() string {
  14. return r.C.StoryID
  15. }
  16. // Title resolves Chapter.title
  17. func (r *ChapterResolver) Title() string {
  18. return r.C.Title
  19. }
  20. // Author resolves Chapter.author
  21. func (r *ChapterResolver) Author() string {
  22. return r.C.Author
  23. }
  24. // Source resolves Chapter.source
  25. func (r *ChapterResolver) Source() string {
  26. return r.C.Source
  27. }
  28. // CreatedDate resolves Chapter.createdDate
  29. func (r *ChapterResolver) CreatedDate() string {
  30. return r.C.CreatedDate.Format(time.RFC3339Nano)
  31. }
  32. // FictionalDate resolves Chapter.fictionalDate
  33. func (r *ChapterResolver) FictionalDate() string {
  34. return r.C.FictionalDate.Format(time.RFC3339Nano)
  35. }
  36. // EditedDate resolves Chapter.editedDate
  37. func (r *ChapterResolver) EditedDate() string {
  38. return r.C.EditedDate.Format(time.RFC3339Nano)
  39. }