Seeking feedback on a PR to run multiple queries concurrently with absinthe_graphql_ws

Hi everyone!

I’ve been a long-time reader of this forum and now it’s time to write my first post, where I wonder if anyone is interested in looking at some code I’ve written and see if I’m going in the right direction.

Some background: We have a GraphQL API with subscriptions, using Absinthe. We’ve had some issues with the “official” way of doing subscriptions over Phoenix Channels over WebSocket, mostly due to the Javascript side of things. After searching for information about this, I stumbled upon an Issue with this library where they instead recommend using absinthe_graphql_ws instead.

Moving to this lib worked great when it comes to subscriptions. However, we also want to do queries over WebSockets and here we ran into some issues. Queries over WebSockets were being run serially. We have some queries that take up to 45s to run, so this was a big issue. We’ve solved it temporarily by just opening one WebSocket per query, but that’s not really an efficient use of resources.

So I did a PR against absinthe_graphql_ws to attempt to make queries run concurrently as well and this is here I would really appreciate some input from someone. I’ve been working with Elixir for a while, but doing this kind of “lower level” process work (I know, it’s not really low level, but lower than just using Phoenix) is new for me. There is not much activity on the project, so I’m hoping that by posting here I can get some feedback.

Kind regards
Patrik Stenmark

1 Like

I think you linked the wrong repo. is private.

Ouch. Too little sleep, too little coffee. Link updated.