Skip to content

Merging to release-5.14.0: [TT-17578] Bump graphql-go-tools to fix Federation subscription-then-query null regression (#8345)#8362

Merged
mativm02 merged 1 commit into
release-5.14.0from
merge/release-5.14.0/63316b393a9849620dece3e7b6447f2fe066dbe2/TT-17578
Jun 24, 2026
Merged

Merging to release-5.14.0: [TT-17578] Bump graphql-go-tools to fix Federation subscription-then-query null regression (#8345)#8362
mativm02 merged 1 commit into
release-5.14.0from
merge/release-5.14.0/63316b393a9849620dece3e7b6447f2fe066dbe2/TT-17578

Conversation

@probelabs

@probelabs probelabs Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

TT-17578 Bump graphql-go-tools to fix Federation subscription-then-query null regression (#8345)

Description

Bumps github.com/TykTechnologies/graphql-go-tools to pick up
TykTechnologies/graphql-go-tools#447.

The bug

On a GraphQL Federation supergraph API, running a subscription
(websocket) first and then a query over the same connection makes the
query return null instead of data. Gateway logs show websocket upgrade for GraphQL engine failed: 'upgrade' token not found in 'Connection' header against the subgraphs. Regression introduced in
5.8.15 / 5.13.1 / 5.14.0 (clean on 5.8.14 and 5.13.0).

Root cause

The gateway tags an inbound websocket subscription request with a
context value GraphQLIsWebSocketUpgrade=true. The library change in
#446 (TT-17442) wrapped the subscription executor's context in a
mergedContext that resolved values from that original request context,
so the flag leaked into every subgraph fetch. The subgraphs then tried
to perform a websocket handshake on plain HTTP fetches, which failed →
null.

The fix (library #447)

The executor now builds its execution context without inheriting the
original request's context values, while still forwarding the
per-request header modifier — preserving TT-17442's per-user
connection/credential isolation. See #447 for details and tests.

Scope

  • Bumps the v1 module only (v1.6.2-0.20260610093432-c7048b604e16
    v1.6.2-0.20260623130956-98d2c88fce43).
  • The gateway's graphql-go-tools/v2 pin predates TT-17442, so the
    v3/v2 engine path is not affected and is intentionally left
    unchanged.

Verification

  • go mod verify passes; internal/graphengine and
    apidef/adapter/... build against the new pin.

Draft — depends on graphql-go-tools#447, which is not merged yet. The
version pin points at the #447 branch commit and must be re-pinned to
the squash-merge commit once #447 lands.

…query null regression (#8345)

## Description

Bumps `github.com/TykTechnologies/graphql-go-tools` to pick up
**TykTechnologies/graphql-go-tools#447**.

### The bug

On a GraphQL Federation supergraph API, running a subscription
(websocket) first and then a query over the same connection makes the
query return `null` instead of data. Gateway logs show `websocket
upgrade for GraphQL engine failed: 'upgrade' token not found in
'Connection' header` against the subgraphs. Regression introduced in
5.8.15 / 5.13.1 / 5.14.0 (clean on 5.8.14 and 5.13.0).

### Root cause

The gateway tags an inbound websocket subscription request with a
context value `GraphQLIsWebSocketUpgrade=true`. The library change in
#446 ([TT-17442]) wrapped the subscription executor's context in a
`mergedContext` that resolved values from that original request context,
so the flag leaked into every subgraph fetch. The subgraphs then tried
to perform a websocket handshake on plain HTTP fetches, which failed →
`null`.

### The fix (library #447)

The executor now builds its execution context without inheriting the
original request's context values, while still forwarding the
per-request header modifier — preserving TT-17442's per-user
connection/credential isolation. See #447 for details and tests.

## Scope

- Bumps the **v1** module only (`v1.6.2-0.20260610093432-c7048b604e16` →
`v1.6.2-0.20260623130956-98d2c88fce43`).
- The gateway's `graphql-go-tools/v2` pin predates TT-17442, so the
v3/v2 engine path is **not** affected and is intentionally left
unchanged.

## Verification

- `go mod verify` passes; `internal/graphengine` and
`apidef/adapter/...` build against the new pin.

> Draft — depends on graphql-go-tools#447, which is not merged yet. The
version pin points at the #447 branch commit and must be re-pinned to
the squash-merge commit once #447 lands.

[TT-17442]:
https://tyktech.atlassian.net/browse/TT-17442?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

(cherry picked from commit 63316b3)
@sentinelone-cnapp-eu1

Copy link
Copy Markdown

SentinelOne CNS Hardcoded Secret Detector
✅ Congratulations, your code is safe

SentinelOne CNS is a cloud-agnostic, agentless CSPM & CWPP solution that continuously detects and prevents vulnerabilities that have the highest probability of being exploited in Azure, AWS, Google Cloud, and Kubernetes.

@mativm02 mativm02 added the deps-reviewed Dependency changes reviewed and approved for CI execution label Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Jira Linter Failed

Commit: f663ca4
Failed at: 2026-06-24 18:50:51 UTC

The Jira linter failed to validate your PR. Please check the error details below:

🔍 Click to view error details
failed to get Jira issue: failed to fetch Jira issue TT-17578: Issue does not exist or you do not have permission to see it.: request failed. Please analyze the request body for more details. Status code: 404

Next Steps

  • Ensure your branch name contains a valid Jira ticket ID (e.g., ABC-123)
  • Verify your PR title matches the branch's Jira ticket ID
  • Check that the Jira ticket exists and is accessible

This comment will be automatically deleted once the linter passes.

@probelabs

probelabs Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

This PR bumps the github.com/TykTechnologies/graphql-go-tools dependency to fix a regression bug in the GraphQL Federation engine. The bug caused queries to return null if they were executed on the same websocket connection after a subscription had been established.

The root cause was a context flag (GraphQLIsWebSocketUpgrade=true) from the initial subscription request leaking into subsequent query operations. This caused the gateway to incorrectly attempt a websocket upgrade when fetching data from subgraphs over plain HTTP, leading to failures.

The updated dependency contains a fix that isolates the execution context for each operation, preventing this flag from being inherited by subsequent queries.

Files Changed Analysis

The changes are confined to dependency management files:

  • go.mod: The version of github.com/TykTechnologies/graphql-go-tools is updated.
  • go.sum: The checksums for the dependency are updated to reflect the new version.

This indicates the change is a dependency bump with no direct modifications to the gateway's source code.

Architecture & Impact Assessment

  • What this PR accomplishes: It resolves a critical regression (TT-17578) affecting GraphQL Federation APIs, restoring the ability to run queries after subscriptions on the same connection.

  • Key technical changes introduced: The core change is the version bump of the graphql-go-tools library from v1.6.2-0.20260610093432-c7048b604e16 to v1.6.2-0.20260624141309-dae0d8d8d038. The fix itself resides within the library, which now prevents context leakage between GraphQL operations.

  • Affected system components: The Tyk Gateway's GraphQL engine is the primary component affected, specifically its handling of GraphQL Federation subscriptions and queries. Users relying on this feature would have been directly impacted by the bug.

Bug and Fix Flow

The following diagrams illustrate the behavior before and after the fix.

Before (Incorrect Flow):

sequenceDiagram
    participant Client
    participant Gateway
    participant Subgraph

    Client->>+Gateway: 1. GraphQL Subscription (WebSocket Upgrade)
    Note over Gateway: Request context is tagged with<br/>`GraphQLIsWebSocketUpgrade=true`
    Gateway-->>-Client: (Subscription established)

    Client->>+Gateway: 2. GraphQL Query (over same connection)
    Note over Gateway: Leaked context is used for query execution.
    Gateway->>+Subgraph: 3. HTTP Fetch (with upgrade context)
    Note over Subgraph: Expects WebSocket upgrade, but gets plain HTTP.
    Subgraph-->>-Gateway: 4. Fails
    Gateway-->>-Client: 5. Returns `null`
Loading

After (Corrected Flow):

sequenceDiagram
    participant Client
    participant Gateway
    participant Subgraph

    Client->>+Gateway: 1. GraphQL Subscription (WebSocket Upgrade)
    Gateway-->>-Client: (Subscription established)

    Client->>+Gateway: 2. GraphQL Query (over same connection)
    Note over Gateway: A new, clean execution context is created.<br/>The upgrade flag is not present.
    Gateway->>+Subgraph: 3. Plain HTTP Fetch
    Subgraph-->>-Gateway: 4. Returns data successfully
    Gateway-->>-Client: 5. Returns query data
Loading

Scope Discovery & Context Expansion

  • The scope is narrowly focused on the v1 engine of the GraphQL Federation feature, as confirmed in the PR description. The v2 engine is unaffected.
  • The impact is limited to the behavior of the GraphQL engine when processing a specific sequence of operations (subscription then query) on a single connection. No other gateway functionality is altered.
  • To further validate the scope, one would typically examine the gateway's source code where the graphql-go-tools library is imported and used, particularly in packages related to the GraphQL engine and request processing, to ensure the dependency bump does not introduce any breaking API changes or unintended side effects.
Metadata
  • Review Effort: 1 / 5
  • Primary Label: bug

Powered by Visor from Probelabs

Last updated: 2026-06-24T18:51:30.239Z | Triggered by: pr_opened | Commit: f663ca4

💡 TIP: You can chat with Visor using /visor ask <your question>

@github-actions

Copy link
Copy Markdown
Contributor

🎯 Recommended Merge Targets

Based on JIRA ticket TT-17578: Starting a subscription on a Federation API breaks subsequent queries

Fix Version: Tyk 5.8.15

Required:

  • release-5.8.15 - Exact version branch for Tyk 5.8.15 - specific patch release
  • release-5.8 - Minor version branch for 5.8.x patches - required for creating Tyk 5.8.15
  • master - Main development branch - ensures fix is in all future releases

📋 Workflow

  1. Merge this PR to master first

  2. Cherry-pick to release branches by commenting on the merged PR:

    • /release to release-5.8.15
    • /release to release-5.8
  3. Automated backport - The bot will automatically create backport PRs to the specified release branches

@probelabs

probelabs Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

✅ Security Check Passed

No security issues found – changes LGTM.

✅ Architecture Check Passed

No architecture issues found – changes LGTM.

✅ Performance Check Passed

No performance issues found – changes LGTM.


Powered by Visor from Probelabs

Last updated: 2026-06-24T18:51:26.621Z | Triggered by: pr_opened | Commit: f663ca4

💡 TIP: You can chat with Visor using /visor ask <your question>

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@mativm02
mativm02 merged commit bebe943 into release-5.14.0 Jun 24, 2026
42 of 51 checks passed
@mativm02
mativm02 deleted the merge/release-5.14.0/63316b393a9849620dece3e7b6447f2fe066dbe2/TT-17578 branch June 24, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deps-reviewed Dependency changes reviewed and approved for CI execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant