strawberry
strawberry copied to clipboard
Add support for multipart subscriptions
This is a new protocol created by Apollo (and supported by Apollo Client)
TODO
- [x] Add support for this in all HTTP integrations that support subscriptions
- [x] Send a ping every 5 seconds (an empty
{}is enough) - [x] Add a proper way to check if an operation is a subscription in our Async HTTP View
- [x] Make sure that the returned responses is actually being streamed
- [x] Return proper error when trying to run a subscription and it's not supported
- [x] Add docs (using a proxy breaks the disconnection)
Protocol docs: https://www.apollographql.com/docs/router/executing-operations/subscription-multipart-protocol/
Codecov Report
Merging #3076 (4f5f1c4) into main (364d152) will increase coverage by
1.05%. The diff coverage is95.91%.
Additional details and impacted files
@@ Coverage Diff @@
## main #3076 +/- ##
==========================================
+ Coverage 95.35% 96.40% +1.05%
==========================================
Files 498 501 +3
Lines 31131 31337 +206
Branches 3809 3854 +45
==========================================
+ Hits 29685 30211 +526
+ Misses 1237 920 -317
+ Partials 209 206 -3
CodSpeed Performance Report
Merging #3076 will not alter performance
Comparing feature/multipart (4f5f1c4) with main (364d152)
Summary
✅ 12 untouched benchmarks
Hi 👋 You can find a preview of the docs here:
https://strawberry.rocks/docs/pr/3076/integrations/index
~~one thing I'm not sure about this is handling client closing the connections 🤔 ~~
edit: this seems to be handled by fastapi, I need to check django and others, also I was using next.js' proxy for this, and that was preventing the disconnect message from being sent
/pre-release
Pre-release
:wave:
Pre-release 0.218.0.dev.1705418681 [48e52e93fff32060fe0be650244907fd3f6ff6cb] has been released on PyPi! :rocket: You can try it by doing:
poetry add strawberry-graphql==0.218.0.dev.1705418681
/pre-release
/pre-release
Apollo Federation Subgraph Compatibility Results
| Federation 1 Support | Federation 2 Support | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Learn more:
Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:
This release adds support for multipart subscriptions in almost all* integrations!
Multipart subcriptions
are a new protocol from Apollo GraphQL, built on the
Incremental Delivery over HTTP spec,
which is also used for @defer and @stream.
The main advantage of this protocol is that when using the Apollo Client
libraries you don't need to install any additional dependency, but in future
this feature will make it easier for us to implement @defer and @stream
Also, this means that you don't need to use Django Channels for subscription, since this protocol is based on HTTP we don't need to use websockets.
- Flask, Chalice and the sync Django integration don't support this yet.
Here's the tweet text:
🆕 Release (next) is out! Thanks to @patrick91 for the PR 👏
Get it here 👉 https://beta.strawberry.rocks/release/(next)