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.
27 lines
527 B
27 lines
527 B
package resolver
|
|
|
|
import (
|
|
"git.aiterp.net/rpdata/api/model/story"
|
|
"git.aiterp.net/rpdata/api/resolver/types"
|
|
)
|
|
|
|
// TagInput resolves the TagInput input
|
|
type TagInput struct {
|
|
Kind string
|
|
Name string
|
|
}
|
|
|
|
// Tags implements the tags query
|
|
func (r *QueryResolver) Tags() ([]*types.TagResolver, error) {
|
|
tags, err := story.ListTags()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
resolvers := make([]*types.TagResolver, len(tags))
|
|
for i, tag := range tags {
|
|
resolvers[i] = &types.TagResolver{T: tag}
|
|
}
|
|
|
|
return resolvers, nil
|
|
}
|