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.

45 lines
929 B

  1. package types
  2. import "git.aiterp.net/rpdata/api/model/character"
  3. // CharacterResolver for the Character graphql type
  4. type CharacterResolver struct{ C character.Character }
  5. // ID is a property resolver
  6. func (r *CharacterResolver) ID() string {
  7. return r.C.ID
  8. }
  9. // Nick is a property resolver
  10. func (r *CharacterResolver) Nick() *string {
  11. if len(r.C.Nicks) == 0 {
  12. return nil
  13. }
  14. return &r.C.Nicks[0]
  15. }
  16. // Nicks is a property resolver
  17. func (r *CharacterResolver) Nicks() []string {
  18. return r.C.Nicks
  19. }
  20. // Name is a property resolver
  21. func (r *CharacterResolver) Name() string {
  22. return r.C.Name
  23. }
  24. // ShortName is a property resolver
  25. func (r *CharacterResolver) ShortName() string {
  26. return r.C.ShortName
  27. }
  28. // Author is a property resolver
  29. func (r *CharacterResolver) Author() string {
  30. return r.C.Author
  31. }
  32. // Description is a property resolver
  33. func (r *CharacterResolver) Description() string {
  34. return r.C.Description
  35. }