mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
16 lines
423 B
Go
16 lines
423 B
Go
package graphql
|
|
|
|
import "context"
|
|
|
|
// resolveWorkContent uses Localization service to fetch preferred content
|
|
func (r *queryResolver) resolveWorkContent(ctx context.Context, workID uint, preferredLanguage string) *string {
|
|
if r.App.Localization == nil {
|
|
return nil
|
|
}
|
|
content, err := r.App.Localization.GetWorkContent(ctx, workID, preferredLanguage)
|
|
if err != nil || content == "" {
|
|
return nil
|
|
}
|
|
return &content
|
|
}
|