package queries import ( "context" "errors" "git.aiterp.net/rpdata/api/models" "git.aiterp.net/rpdata/api/models/characters" ) func (r *resolver) Character(ctx context.Context, id *string, nick *string) (models.Character, error) { if id != nil { return characters.FindID(*id) } else if nick != nil { return characters.FindNick(*nick) } else { return models.Character{}, errors.New("You must specify either an ID or a nick") } } func (r *resolver) Characters(ctx context.Context, filter *characters.Filter) ([]models.Character, error) { return characters.List(filter) }