### **User description**
This PR adds the logic for `use_immutable_headers` for GraphQL
proxy-only
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test
coverage to functionality)
___
### **PR Type**
Enhancement, Tests
___
### **Description**
- Added `use_immutable_headers` feature to GraphQL proxy-only mode.
- Updated reverse proxy and transport logic to handle
`use_immutable_headers` flag.
- Refactored header configuration to use new structs.
- Added comprehensive tests for new feature in middleware and transport.
___
### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Tests
</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>mw_graphql_test.go</strong><dd><code>Add tests for
use_immutable_headers feature in GraphQL
middleware</code></dd></summary>
<hr>
gateway/mw_graphql_test.go
<li>Added tests for <code>use_immutable_headers</code> feature.<br> <li>
Differentiated behavior based on <code>use_immutable_headers</code>
flag.<br>
</details>
</td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6315/files#diff-72c11b8efcaceccfbbd87e75565353706443bf56420d3fdba6b5bf5f632f4b33">+79/-34</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>transport_test.go</strong><dd><code>Add tests for
use_immutable_headers feature in transport</code> </dd></summary>
<hr>
internal/graphengine/transport_test.go
- Added tests for `use_immutable_headers` feature in transport.
</details>
</td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6315/files#diff-14490e6a204ab6724dd57f0f7f840b6d9b200f68bccf8d8df87c8d41321551f6">+114/-0</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Enhancement
</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>reverse_proxy.go</strong><dd><code>Update reverse proxy
to support use_immutable_headers feature</code></dd></summary>
<hr>
gateway/reverse_proxy.go
<li>Updated reverse proxy handling to include
<code>use_immutable_headers</code> flag.<br> <li> Refactored header
configuration handling.<br>
</details>
</td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6315/files#diff-e6e07722257f7e41691e471185ad6d84fd56dc9e5459526ea32e9a5e8fa1a01b">+13/-8</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>engine.go</strong><dd><code>Extend ReverseProxyParams
with header configuration structs</code></dd></summary>
<hr>
internal/graphengine/engine.go
<li>Added <code>HeadersConfig</code> to
<code>ReverseProxyParams</code>.<br> <li> Introduced
<code>ReverseProxyHeadersConfig</code> and
<code>ProxyOnlyHeadersConfig</code> <br>structs.<br>
</details>
</td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6315/files#diff-9d1ef4ec1b59d708ed86c7cc348b73bd0b619ef034094b5fbd4b138e11ccde6e">+16/-7</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>graphql_go_tools_v1.go</strong><dd><code>Modify GraphQL
transport initialization for header configuration</code></dd></summary>
<hr>
internal/graphengine/graphql_go_tools_v1.go
- Updated transport initialization to use `HeadersConfig`.
</details>
</td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6315/files#diff-e592cc8ca6ac39e7574765d7f2bbf19193f173791a1b0930d4dde7f9412dc882">+1/-1</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>graphql_go_tools_v2.go</strong><dd><code>Modify GraphQL
transport initialization for header configuration</code></dd></summary>
<hr>
internal/graphengine/graphql_go_tools_v2.go
- Updated transport initialization to use `HeadersConfig`.
</details>
</td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6315/files#diff-2e41b60f046c2947fbedb8fb841b5c3c962798e3ba8211c7144f326436ffabe3">+2/-1</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>transport.go</strong><dd><code>Refactor transport to
use HeadersConfig and support
</code><br><code>use_immutable_headers</code></dd></summary>
<hr>
internal/graphengine/transport.go
<li>Refactored transport to use <code>HeadersConfig</code> for header
rewrites.<br> <li> Added logic to respect
<code>use_immutable_headers</code> flag.<br>
</details>
</td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6315/files#diff-564061c9b29366529eb1f6f10fe39671d2ac738a4731ffd2c8b04dcc0a8cd610">+10/-12</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
___
> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools
and their descriptions
User description
This PR adds the logic for
use_immutable_headersfor GraphQL proxy-onlyTypes of changes
PR Type
Enhancement, Tests
Description
use_immutable_headersfeature to GraphQL proxy-only mode.use_immutable_headersflag.Changes walkthrough 📝
mw_graphql_test.go
Add tests for use_immutable_headers feature in GraphQL middlewaregateway/mw_graphql_test.go
use_immutable_headersfeature.use_immutable_headersflag.transport_test.go
Add tests for use_immutable_headers feature in transportinternal/graphengine/transport_test.go
use_immutable_headersfeature in transport.reverse_proxy.go
Update reverse proxy to support use_immutable_headers featuregateway/reverse_proxy.go
use_immutable_headersflag.engine.go
Extend ReverseProxyParams with header configuration structsinternal/graphengine/engine.go
HeadersConfigtoReverseProxyParams.ReverseProxyHeadersConfigandProxyOnlyHeadersConfigstructs.
graphql_go_tools_v1.go
Modify GraphQL transport initialization for header configurationinternal/graphengine/graphql_go_tools_v1.go
HeadersConfig.graphql_go_tools_v2.go
Modify GraphQL transport initialization for header configurationinternal/graphengine/graphql_go_tools_v2.go
HeadersConfig.transport.go
Refactor transport to use HeadersConfig and supportuse_immutable_headersinternal/graphengine/transport.go
HeadersConfigfor header rewrites.use_immutable_headersflag.