-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is an update using Apollo's SubscriptionClient required? #26
Comments
I think this library provides an alternative to subscriptions-transport-ws, in collaboration with |
And it works great, by the way, thanks @vic 👍 Must say I have not begun using subscriptions, but doing queries / mutations over WS is already very smooth :-) |
Not sure what about my setup is different than yours @arjan, but I wasn't able to get this lib working. It might have had something to do with #14, not quite sure. Ultimately, I rolled my own called Phoenix Websocket Network Interface which seems to be more inline with the Apollo recommended interface structure. No subscriptions yet, but I'm using it for queries/mutations over sockets. @vic if you check mine out, please let me know what you think. I had originally considered forking yours, but it seemed a bit too far off from the structure I was thinking, and I wasn't ready to jump into using Ramda. |
@bjunc dont think it's something related to #14 will have to fix that anyways, I'm just too far from the computer these days :) So, sorry for not responding as quick as I'd like to. Sad to hear this lib didn't work for you, I built it just for a customer project a few months ago, and share it with the hope of it being useful to others, if it's not, you are totally free to create your own, fork or otherwise contribute to this one (as I said I'm actually a bit far from keyboard these days, so it'd be wonderful some help handling issues and PRs). And yes, haha, I used ramda mainly because I'm mostly confortable doing Elixir and thinking a bit more functional than normal Js. How is APW not inline with the apollo recommended interface structure, perhaps you can share some info on how we can improve ? Cheers ! |
No problem about the response delays, totally understandable. Apollo 1.x convention is to expose a I'm not exactly sure what about APW wasn't working, but I was able to use your socket interfacing logic to get me pointed in the right direction (so thanks!). All that said, Apollo 2.0 is out now, which changes the convention again. Now, instead of "network interfaces", they use "links". Funny enough, "links" work kind of like plugs. You create a link chain, with each link feeding into the next, before ultimately resolving. I was able to create a new What do you think makes the most sense for the community? |
FWIW, hitting this as well. My network interfaces seem to want to hit http://localhost:3000/graphql when my Phoenix server actually listens on ws://localhost:4000/socket. I think I actually had this working on an earlier version of Apollo, maybe 1.9.1 or something, but 1.9.3 seems to have changed something that has broken this. Anyhow, no pressure, I'm just adding my voice and experiences in case they help someone else. |
@ndarilek Yeah, that's the same issue I was experiencing. Basically, the network interface is being ignored, and defaulting to a basic HTTP network interface. Feel free to try my Apollo 1.x based PhoenixWebSocketNetworkInterface. It works for me, in both server (Node.js) and browser environments. Also, I just pushed a first draft Apollo 2.0 link: PhoenixWebSocketLink. This is also working for me in both server and browser environments. I'll be focusing on this moving forward (as opposed to Apollo 1.x). You can add via npm/yarn: In neither case am I using subscriptions, but query/mutations are working great. |
@bjunc Oh so, the interface has changed for apollo 2.0. It would be nice to state in the README the last apollo version people has been able to get APW to work with. Feel free to send a PR and link to your Apollo 2.0 link if that helps people use the newest version. |
@vic It seems something might have changed with Apollo around Here's my PhoenixWebSocketLink for Apollo 2.0. Still prototype phase, but it's working for queries / mutations. |
Yea just took a look at Apollo 2.0 yesterday and noticed the changes. @bjunc is on the right track with a new Have a pretty big react-apollo application - am interested in the potential performance improvements of 2.0 |
I'm really interesting in your PhoenixWebSocketLink because I need a way to work with Apollo 2.0 subscriptions in my react-native application with react-apollo. I can't get any way to do that it's works! |
Does this library need to be updated to work with the latest version of Apollo? If I use this lib's
createNetworkInterface
, the console is showingHTTPFetchNetworkInterface
is being used, and the URI seems to default to/graphql
.Per the Apollo docs, to use "full websocket" (all queries, mutations, and subscriptions over
ws
):The text was updated successfully, but these errors were encountered: