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