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 }