Add console GraphQL schema and resolvers for i18n

Add CookieBannerTranslation type, defaultLanguage field on
CookieBanner, and upsert/delete mutations for managing
per-language translations from the console.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-23 10:49:19 +04:00
parent ef60f080f1
commit 04001c0d90
4 changed files with 154 additions and 1 deletions

View File

@@ -64,6 +64,7 @@ type (
PrivacyPolicyURL *string
ConsentExpiryDays *int
ConsentMode *coredata.CookieConsentMode
DefaultLanguage *string
}
UpdateCookieCategoryRequest struct {
@@ -706,7 +707,7 @@ func (s *Service) UpdateCookieBanner(
return fmt.Errorf("cannot load cookie banner: %w", err)
}
consentChanged := req.PrivacyPolicyURL != nil || req.ConsentExpiryDays != nil || req.ConsentMode != nil
consentChanged := req.PrivacyPolicyURL != nil || req.ConsentExpiryDays != nil || req.ConsentMode != nil || req.DefaultLanguage != nil
if req.Name != nil {
banner.Name = *req.Name
@@ -723,6 +724,9 @@ func (s *Service) UpdateCookieBanner(
if req.ConsentMode != nil {
banner.ConsentMode = *req.ConsentMode
}
if req.DefaultLanguage != nil {
banner.DefaultLanguage = *req.DefaultLanguage
}
banner.UpdatedAt = time.Now()