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.
23 lines
494 B
23 lines
494 B
package queries
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.aiterp.net/rpdata/api/graphql/resolver/types"
|
|
"git.aiterp.net/rpdata/api/model/story"
|
|
)
|
|
|
|
// ChapterArgs is args for chapter query
|
|
type ChapterArgs struct {
|
|
ID string
|
|
}
|
|
|
|
// Chapter resolves the chapter query
|
|
func (r *QueryResolver) Chapter(ctx context.Context, args *ChapterArgs) (*types.ChapterResolver, error) {
|
|
chapter, err := story.FindChapterID(args.ID)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &types.ChapterResolver{C: chapter}, nil
|
|
}
|