lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Provide a new modern pusher link implementation for Subscription for Apollo Client (based on Graphql-ws)

Open SirMishaa opened this issue 3 years ago • 3 comments

What problem does this feature proposal attempt to solve? Hello,

I recently had to use the client implementation of Pusher for Apollo as shown on the documentation. It was already not super simple because it didn't have Typescript types, so I had to attempt to deduce what was going on behind it.

But more importantly, when you use the link, if an error happens on the server side, you end up with a complete crash, even if you handle the errors correctly. (See https://stackoverflow.com/a/71060121/10230961). It was an absolute pain.

Which possible solutions should be considered?

My idea here is to provide a new updated link, with a Typescript definition, based on the new native link provided by Apollo (https://github.com/apollographql/apollo-client/pull/9369) forked from the modern library https://github.com/enisdenjo/graphql-ws

This will make it easy to use Laravel Lighthouse subscription with Apollo (the most used GraphQL client) and will not cause any difficulties anymore.

I can try to make a PR for this, but I might need some help too, as there are some gray areas I still have on how the link implementation for Pusher given in the documentation works.

SirMishaa avatar Mar 04 '22 20:03 SirMishaa

It would be great to see the docs for this improved. I have never used subscriptions myself, so I can not help much.

spawnia avatar Mar 07 '22 11:03 spawnia