Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale Information from the Request are not Respected in the Execution Context #587

Open
chbriem opened this issue Mar 5, 2025 · 0 comments
Labels

Comments

@chbriem
Copy link

chbriem commented Mar 5, 2025

Describe the bug
When a locale setting is transported through a HTTP request, using a Accept-Language header, this information seems not to be transported to the ExecutionContext, finally not ending up in the DataFetchingEnvironment where I want to use it. The locale that I receive on the DataFetchingEnvironment is the default locale of the Java Runtime Environment.

To Reproduce
Steps to reproduce the behavior:

  1. Implement a locale-dependent data fetching.
  2. Change the language, i.e. the Accept-Language header changes.
  3. The shown text is still in the default locale of the server system.

Expected behavior
I expect the locale information to be available at the DataFetchingEnvironment, as it has been sent with the Accept-Language header in the HTTP requests. The shown/returned text from the GraphQL interface is then switched to the expected locale (if correctly implemented).

Screenshots
No screenshots atm. Topic is more implementation-related.

Desktop (please complete the following information):

  • OS: N/A (Windows in my case)
  • Browser: N/A (Chrome in my case)
  • Version: Windows 11, Chrome Version 133.0.6943.142

Additional context
I guess the information is somehow "lost" on the way from the HTTP request object to the DataFetchingEnvironment instance.

@chbriem chbriem added the bug label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant