genqlient icon indicating copy to clipboard operation
genqlient copied to clipboard

Subscription support

Open matthieu4294967296moineau opened this issue 1 year ago • 6 comments

Added support for graphQL subscriptions.

  • Using graphql.NewClientUsingWebSocket(), the returned graphql.WebSocketClient will be able to subscribe to graphQL endpoints.
  • Implementation does not depend on a specific websocket package, but it is similar to github.com/gorilla/websocket (this package is also used to create a client in the tests).

I have:

  • [x] Written a clear PR title and description (above)
  • [x] Signed the Khan Academy CLA
  • [x] Added tests covering my changes, if applicable
  • [x] Included a link to the issue fixed, if applicable
  • [x] Included documentation, for new features
  • [x] Added an entry to the changelog

Hi! In addition to your CEO, you also need to sign the CLA as yourself, since you are the one contributing the code. Thanks!

StevenACoffman avatar Sep 04 '23 18:09 StevenACoffman

Hi! In addition to your CEO, you also need to sign the CLA as yourself, since you are the one contributing the code. Thanks!

Done !

According to your comments, I modified the code so that it is now possible to have several subscriptions using the same webSocket connection. There is also now only 1 go routine that runs to listen the webSocket messages instead of 2 before. I also made the minor changes listed in the previous comments.

@matthieu4294967296moineau Any updates here? It would be great to have this available! 🤗

HaraldNordgren avatar Apr 12 '24 11:04 HaraldNordgren