|
|
@ -2,9 +2,9 @@ package types |
|
|
|
|
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"errors" |
|
|
|
|
|
|
|
"git.aiterp.net/rpdata/api/models/characters" |
|
|
|
|
|
|
|
"git.aiterp.net/rpdata/api/internal/loader" |
|
|
|
"git.aiterp.net/rpdata/api/models" |
|
|
|
) |
|
|
|
|
|
|
@ -15,7 +15,12 @@ func (r *commentResolver) Character(ctx context.Context, obj *models.Comment) (* |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
|
|
|
|
character, err := characters.FindID(obj.CharacterID) |
|
|
|
loader := loader.FromContext(ctx) |
|
|
|
if loader == nil { |
|
|
|
return nil, errors.New("no loader") |
|
|
|
} |
|
|
|
|
|
|
|
character, err := loader.Character("id", obj.CharacterID) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|