You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To support all three main GraphQL operations: query, mutation, and subscription.
How
Research what this new feature would imply technically.
Design and discuss a public API of the library for GraphQL subscriptions.
Implement, document, and release.
Technical notes
GraphQL subscriptions are often implemented via WebSockets. There is a WebSockets support feature request open, which may be a pre-requisite for this task.
Reacted by Marco Moretti, Victor Martinelli, Henry S, Daniel Almaguer, Steven Heffner, Alex Nelson, Donovan Hiland, Dan Gurney, Sharfin Jahan Sakib, Julian Daberkow and 47 more
@hsavit1 as far as I know, GraphQL subscription is an abstraction over WebSocket. Subscriptions support would require a WebSocket support as a pre-requisite (#156). I cannot recommend any solution to achieve that at the moment. WebSocket support is on the roadmap, but I wouldn't expect it any time soon, unless you wish to contribute to it.
The best I could come up with so far to have graphql-ws run cleanly was to do this in the client in order to avoid sending to graphql-ws during tests ...
I'm opening a discussion for the GraphQL subscriptions support at #2352. Please participate, read through the document, and share your thoughts! Those are highly appreciated.
The implementation itself is likely to happen next year. Thanks.
Activity
hsavit1 commentedon Aug 13, 2020
are there any stopgap solutions that you can recommend until this feature is built @kettanaito ?
kettanaito commentedon Aug 14, 2020
@hsavit1 as far as I know, GraphQL subscription is an abstraction over WebSocket. Subscriptions support would require a WebSocket support as a pre-requisite (#156). I cannot recommend any solution to achieve that at the moment. WebSocket support is on the roadmap, but I wouldn't expect it any time soon, unless you wish to contribute to it.
Nabrok commentedon Aug 25, 2022
I finally followed the advice from apollo and moved from subscription-transport-ws to graphql-ws.
Everything is working and tests even pass, but unfortunately they also spit out ...
With subscription-transport-ws I just had an unhandled GET request, which I could ignore with ...
The best I could come up with so far to have graphql-ws run cleanly was to do this in the client in order to avoid sending to graphql-ws during tests ...
And then a handler like this ...
This is kind of ugly and I don't like it. There must be a better way to just ignore subscriptions?
Nabrok commentedon Aug 26, 2022
Okay, cleaner work around ...
In
__mocks__/@apollo/client/link/subscriptions.tsThis is basically just the code for apollo versions < 3.5.10 but with the error function doing nothing.
Then just need the
rest.gethandler in my earlier post.sutt0n commentedon Oct 29, 2024
Definitely looking forward to this feature since #2011 has been merged. 🙂
kettanaito commentedon Nov 8, 2024
Update
I'm opening a discussion for the GraphQL subscriptions support at #2352. Please participate, read through the document, and share your thoughts! Those are highly appreciated.
The implementation itself is likely to happen next year. Thanks.
kettanaito commentedon Sep 28, 2026
Released: v3.0.0 🎉
This has been released in v3.0.0.
Get these changes by running the following command:
Predictable release automation by Release.
⬆️ Update dependency msw to v3
⬆️ Update dependency msw to v3
⬆️ Update dependency msw to v3
⬆️ Update dependency msw to v3
⬆️ Update dependency msw to v3
⬆️ Update dependency msw to v3