graph2: Added Chapter type and queries, moved loader out of old graphql pkg.
the build failed

This commit is contained in:
2018-09-16 10:33:55 +02:00
parent 0768cfd0bd
commit 875dac9ecb
10 changed files with 178 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package types
import (
"context"
"time"
"git.aiterp.net/rpdata/api/models"
)
type chapterResolver struct{}
func (r *chapterResolver) FictionalDate(ctx context.Context, chapter *models.Chapter) (*time.Time, error) {
if chapter.FictionalDate.IsZero() {
return nil, nil
}
return &chapter.FictionalDate, nil
}
// ChapterResolver is a resolver
var ChapterResolver chapterResolver