nuwave / nuwave/lighthouse

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

Open
#2,079 3 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
PHP
Stars
3.5k
Forks
468
Avg merge
3h 9m
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing Pusher subscription link described in the Lighthouse documentation, then compare Apollo Client's native link with the graphql-ws implementation referenced in the issue. Done means Lighthouse provides a modern, typed Apollo-compatible subscription link based on graphql-ws and avoids the reported server-error crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, laravel, php, typescript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.