GraphQL API and utilities for the rpdata project
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.
 
 

32 lines
610 B

package resolvers
import (
"context"
"git.aiterp.net/rpdata/api/graph2/graphcore"
"git.aiterp.net/rpdata/api/models"
"git.aiterp.net/rpdata/api/models/unknownnicks"
)
/// Queries
func (r *queryResolver) UnknownNicks(ctx context.Context, filter *graphcore.UnknownNicksFilter) ([]*models.UnknownNick, error) {
limit := 100
if filter != nil {
if filter.Limit > 0 {
limit = filter.Limit
}
}
nicks, err := unknownnicks.List(limit)
if err != nil {
return nil, err
}
nicks2 := make([]*models.UnknownNick, len(nicks))
for i := range nicks {
nicks2[i] = &nicks[i]
}
return nicks2, nil
}