mercurius-js / mercurius

Implement GraphQL servers and gateways with Fastify
https://mercurius.dev/
MIT License
2.35k stars 237 forks source link

feat: implement graphql-ws ping/pong #852

Closed andreialecu closed 2 years ago

andreialecu commented 2 years ago

Fixes #851

Here's a screenshot to confirm:

Screenshot 2022-08-27 at 20 12 54
andreialecu commented 2 years ago

Not sure why some other lines got reformatted, I ran npm run lint:fix

andreialecu commented 2 years ago

I set it to draft while I verify some things. I'm still unsure if the graphql-ws client can properly understand server-sent keep-alive messages, a.k.a. Server -> Client.

However, at least this works Client -> Server and mercurius now responds properly.

andreialecu commented 2 years ago

Confirmed to work bidirectionally. There was a minor issue that I fixed and force pushed.

Notice by the arrows how some are incoming and some outgoing, but it works both ways.

Screenshot 2022-08-27 at 20 40 30