Skip to content

Conversation

@magicmark
Copy link

@magicmark magicmark commented Nov 12, 2025

Fix #463 -- implement support for Subscriptions over HTTP/1 multipart responses

See: https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol

This PR was initially authored by Claude Code, but I have since made significant changes.

fwiw in the process of implementing this, I also stumbled upon an edge case which possibly requires an upstream fix to aiohttp: aio-libs/aiohttp#11857


Claude's slop PR description fwiw:

Implements the multipart subscription protocol for receiving streaming subscription updates over HTTP as an alternative to WebSocket transports. This protocol is implemented by Apollo GraphOS Router and other compatible servers, and is particularly useful when WebSocket connections are not available or blocked by infrastructure.

The transport handles multipart/mixed responses with heartbeat support and proper error handling for both GraphQL and transport-level errors. It requires servers to support the multipart subscription protocol - requests that don't receive a multipart response will fail with a clear error message.

🤖 Generated with Claude Code

@magicmark
Copy link
Author

cc @patrick91 ;)

@leszekhanusz
Copy link
Collaborator

Thanks for your work on this!

So do you know if there is a public backend somewhere supporting this protocol?

@magicmark
Copy link
Author

magicmark commented Nov 12, 2025

So do you know if there is a public backend somewhere supporting this protocol?

not that i know of - but i'll start doing that now, i can throw something up on a lambda worker

@leszekhanusz
Copy link
Collaborator

not that i know of - but i'll start doing that now, i can throw something up on a lambda worker

Great!

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 99.17355% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.97%. Comparing base (7fb869a) to head (364f340).
⚠️ Report is 45 commits behind head on master.

Files with missing lines Patch % Lines
gql/transport/http_multipart_transport.py 99.17% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master     #574      +/-   ##
===========================================
- Coverage   100.00%   99.97%   -0.03%     
===========================================
  Files           38       41       +3     
  Lines         2908     3361     +453     
===========================================
+ Hits          2908     3360     +452     
- Misses           0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leszekhanusz
Copy link
Collaborator

leszekhanusz commented Nov 12, 2025

For the linting issues, you should run make check to fix the code. See CONTRIBUTING.md

@magicmark
Copy link
Author

magicmark commented Nov 13, 2025

@leszekhanusz https://github.com/magicmark/gql-book-server/ :)

publicly accessible here here: https://gql-book-server.fly.dev/graphql

(I was too dumb to get multipart + chunked transfer encoding working via a lambda so just deploying on the cheapest fly.io machine possible)

@magicmark magicmark force-pushed the add_http_multipart_transport branch from 131a424 to 6c5c850 Compare November 13, 2025 06:50
@magicmark magicmark force-pushed the add_http_multipart_transport branch 3 times, most recently from c2ec83b to 47d0364 Compare December 19, 2025 22:47
@magicmark magicmark marked this pull request as ready for review December 19, 2025 22:54
This commit adds support for HTTP multipart transport, which allows
GraphQL subscriptions to work over HTTP using the multipart response format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@magicmark magicmark force-pushed the add_http_multipart_transport branch from 47d0364 to c41c1d1 Compare December 20, 2025 00:06
@magicmark
Copy link
Author

@leszekhanusz ready for review!

@leszekhanusz
Copy link
Collaborator

@magicmark Thanks for the work and the backend. Do you want me to push it over the finish line by fixing the few remaining issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support Subscriptions HTTP Multipart Protocol

2 participants