ChilliCream / ChilliCream/graphql-platform

[Fusion] Allow header propagation for the Accept header

Open
#7,273 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate Area: Fusion
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.