apollo-client icon indicating copy to clipboard operation
apollo-client copied to clipboard

Support extensions in useSubscription

Open jcostello-atlassian opened this issue 1 year ago • 6 comments
trafficstars

This adds optional support for extensions in useSubscription following the graphql-ws spec:

https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md

jcostello-atlassian avatar May 17 '24 15:05 jcostello-atlassian

@jcostello-atlassian: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

apollo-cla avatar May 17 '24 15:05 apollo-cla

Deploy request for apollo-client-docs pending review.

Visit the deploys page to approve it

Name Link
Latest commit 81bc23d4e4ee5e9f6baf794784a2925748664595

netlify[bot] avatar May 17 '24 15:05 netlify[bot]

🦋 Changeset detected

Latest commit: 81bc23d4e4ee5e9f6baf794784a2925748664595

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@apollo/client Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 17 '24 15:05 changeset-bot[bot]

Thank you for the PR!

I'm gonna be honest, the two of us have the worst timing: I'm in the middle of rewriting that hook right now (you can see the current progress over here: https://github.com/apollographql/apollo-client/pull/11511/files#diff-aa77d592927baae676cedc8e3fda943bf63744e885b0328371c6ebd9d18aebdb) because previously it was breaking multiple rules of hooks and I can't find a minimal angle of fixing it.

Looking at this, I'm already happy that most of your changes are in the core. Phew 😅

I just wanted to let you know - we'll look at this, but before that we have to figure out #11511, I hope that's okay!

phryneas avatar May 17 '24 16:05 phryneas

Thanks for the heads up @phryneas! I'll close this for now and will raise an issue for future reference:

https://github.com/apollographql/apollo-client/issues/11856

jcostello-atlassian avatar May 17 '24 16:05 jcostello-atlassian

No, please keep it open - you put a lot of work into this and I believe we'll be able to salvage most of it. Your contribution here is very welcome!

It just might take a while :)

phryneas avatar May 17 '24 16:05 phryneas

Hey @jcostello-atlassian! It has been a while, but the https://github.com/apollographql/apollo-client/tree/release-3.11 branch now contains the new useSubscription implementation - could you please update this PR for that? :)

phryneas avatar Jul 03 '24 11:07 phryneas