hasura / hasura/graphql-engine

Accept-Language header is not forwarded to service using remote GraphQL schema

Open
#9,258 0 comments 0 reactions 0 assignees View on GitHub
k/bug t/gql-services
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: 2.8.3

### Environment

* React-based frontend that uses Apollo Client to for GraphQL queries
* Express-based backend service that uses Apollo Server
* Hasura graphql engine in between

### What is the current behaviour?

Accept-Language header is not received in the backend service.

### What is the expected behaviour?

Accept-Language header should be contained in the tcp packet that the express-server receives.

### How to reproduce the issue?

1. In the frontend ensure that a header 'Accept-Language' is sent e.g. with value "en", in my case this is done through apollo client but this should be also possible with other clients
2. Allow header forwarding in the remote schemas configuration file
`- name: MyApi
definition:
url_from_env: MY_API_URL
timeout_seconds: 60
forward_client_headers: true`
4. In the backend service check for the 'Accept-Language' header or alternatively monitor the tcp packets (e.g. via tcpdump)

### Any possible solutions/workarounds you're aware of?

If a different header name is used (e.g. "X-Accept-Language"), the header is forwarded as expected.

This might be related to https://github.com/hasura/graphql-engine/issues/5006

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the React/Apollo Client frontend, Hasura remote schema configuration, and Express/Apollo Server backend described here. Start by tracing header forwarding with forward_client_headers enabled and compare Accept-Language with a custom X-Accept-Language header. Done means Accept-Language reaches the backend service, with regression coverage for the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, react, typescript
Domain
api, backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.