ChilliCream / ChilliCream/graphql-platform
[Fusion] Allow header propagation for the Accept header
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Product
Hot Chocolate
Is your feature request related to a problem?
We have a Fusion gateway in front of several Hotchocolate subgraphs.
We are using v13.9.6, which requires that the data field not be null. Because of this, if the request failed for fatal reasons: Validation, Auth, etc, the Data object would be null and if using the latest GraphQL Spec this would result in a 500 http status response.
To work around this, we decided to use the legacy spec by adding the header accept: application/json and then adding that header to our HeaderPropagation configuration.
However, we discovered that Fusion is hardcoding the Accept header to be application/graphql+json when making calls from the gateway to the subgraphs.
Our hacky workaround:
We register a DelegatingHandler on each HttpClient for the subgraphs, and we force the header to be whatever the client passed up even though Fusion is trying to hard-code it.
The solution you'd like
If Accept is listed in the HeaderPropagation options, then propagate it through to the subgraphs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Fusion gateway requests to subgraphs and the HeaderPropagation options, focusing on the DelegatingHandler and HttpClient behavior described in the issue. Check where the gateway sets the Accept header and verify that configuring Accept for propagation allows the client’s value to reach subgraphs without the workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100