Update user friendly errors for translations (#15000)

Force msg typing instead of string for user friendly errors
This commit is contained in:
Félix Malfait
2025-10-09 18:17:32 +02:00
committed by GitHub
parent 660cd38f35
commit e577c2d746
124 changed files with 796 additions and 563 deletions
@@ -96,11 +96,14 @@ export class ApolloFactory<TCacheShape> implements ApolloManager<TCacheShape> {
const authLink = setContext(async (_, { headers }) => {
const tokenPair = getTokenPair();
const locale = this.currentWorkspaceMember?.locale ?? i18n.locale;
if (isUndefinedOrNull(tokenPair)) {
return {
headers: {
...headers,
...options.headers,
'x-locale': locale,
},
};
}
@@ -112,9 +115,7 @@ export class ApolloFactory<TCacheShape> implements ApolloManager<TCacheShape> {
...headers,
...options.headers,
authorization: token ? `Bearer ${token}` : '',
...(this.currentWorkspaceMember?.locale
? { 'x-locale': this.currentWorkspaceMember.locale }
: { 'x-locale': i18n.locale }),
'x-locale': locale,
...(this.currentWorkspace?.metadataVersion && {
'X-Schema-Version': `${this.currentWorkspace.metadataVersion}`,
}),