-
Notifications
You must be signed in to change notification settings - Fork 189
Add HTTP multipart transport for GraphQL subscriptions #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add HTTP multipart transport for GraphQL subscriptions #574
Conversation
|
cc @patrick91 ;) |
|
Thanks for your work on this! 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 |
Great! |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
|
For the linting issues, you should run |
|
@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) |
131a424 to
6c5c850
Compare
c2ec83b to
47d0364
Compare
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>
47d0364 to
c41c1d1
Compare
|
@leszekhanusz ready for review! |
|
@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? |
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