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.
 
 

22 lines
555 B

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