-
Notifications
You must be signed in to change notification settings - Fork 9
WIP: Feature/subscription #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
Conversation
|
@vic Great! This will be really useful to me! Thanks, I will do some testing on this later today. |
|
@conor-mac-aoidh great! Please let me know if you try this with the example phoenix backend, that would be awesome. Only issue would be that right now, we use the same topic for sending the subscription and for listenning for subscription messages. Middlewares' can now read |
|
@vic Sorry I haven't had a chance to test this yet! The example app does not actually use apollo or apollo-phoenix-websocket, so in order to test it I will have to do some work on the frontend to use those libs. Hopefully I'll get around to it in the next week or so. |
|
@conor-mac-aoidh No problem, I've also been not close to the computer this month, hopefully will find some time this or next week to explore this further. |
|
Update on this branch progress... [cc @G3z] Just merged master on this branch, but still not properly subscribing to the backend. Made a phoenix_chat_example apollo branch on which I'm trying to rewrite the I was thinking the server would send the message-name under which new subscription data will be received, but looking at the example |
|
today I made some changes and got this branch working with the example chat application. Here's how you can help testing this.. (cc @conor-mac-aoidh @G3z) # clone, or fetch and checkout the feature/subscription branch
git clone [email protected]:vic/apollo-phoenix-websocket --branch feature/subscription
cd apollo-phoenix-websocket
npm install && npm run compile
# then clone my chat app fork on apollo branch
git clone github.com:vic/phoenix_chat_example.git --branch apollo
cd phoenix_chat_example
npm install
# either npm link or just symlink to our recently compiled APW
rm -rf node_modules/apollo-phoenix-websocket
ln -s /path/to/apollo-phoenix-websocket node_modules/
# run the server
mix deps.get
mix phoenix.serverOpen two browsers and they should be able to talk to each other. You might want to take a look at the client side app using APW here (I've renamed the original bare-sockets App as App0 for reference) On the backend, the only change I made to the original On the client side, and important change is the addition of a required configuration option
This function gets called with the resolution of the |
|
Oh forgot to mention, things are highly experimental haha as I didn't implement tests for this :/ and some things like unsubscribing are not implemented. |
|
Been following the main Absinthe Subscription issue, your library is mentioned there! @benwilson512 made the following comment a few weeks back. : Looks like you did implement it with the POC he is mentioning - may want to jump in that thread and let them know what you have learned! |
|
Hey everyone! Absinthe subscriptions is coming along soon, kudos to @benwilson512 et al. for their awesome work on it. So I've updated this branch and I guess it's finally time to merge it into master. I've updated the README and released APW |

Closes #7