Skip to content

Commit

Permalink
MPDX-8309 Send user's language to GraphQL server (#1095)
Browse files Browse the repository at this point in the history
We add the header accept-language and make it blank to ensure the server takes the user's language preference into account when returning the constants API results.
  • Loading branch information
dr-bizz authored Sep 27, 2024
1 parent dfc6ea2 commit 48d1bf9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/apollo/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export const makeAuthLink = (apiToken: string) =>
headers: {
...headers,
Authorization: `Bearer ${apiToken}`,
// We pass through a empty Accept-Language header to the API to avoid it defaulting to 'en-US'
// The API uses this header to determine the language of the response
// if there is no header it goes off the user's account settings, which is what we want.
'Accept-Language': '',
},
}));
return forward(operation);
Expand Down

0 comments on commit 48d1bf9

Please sign in to comment.