Skip to content
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

Subscriptions #37

Open
3nigm4 opened this issue Jun 18, 2018 · 4 comments
Open

Subscriptions #37

3nigm4 opened this issue Jun 18, 2018 · 4 comments

Comments

@3nigm4
Copy link

3nigm4 commented Jun 18, 2018

Hello,

thanks for this library. The latest GraphQL spec was just released and a lot of stuff on your roadmap is now part of the spec, like subscriptions.... https://github.com/facebook/graphql/releases/tag/June2018
... therefor ...
Featuer Request 🥇 Subscriptions

@jamesmacaulay
Copy link
Owner

Thanks for the heads up about this! I will dig into the new spec and try to put some time into implementation soon.

@jamesmacaulay
Copy link
Owner

jamesmacaulay commented Jul 10, 2018

I've now done a fair bit of research into this and unfortunately I've encountered a huge roadblock: the most popular transport protocol for GraphQL subscriptions relies on the client specifying the protocols argument of the WebSocket constructor. Unfortunately the elm-lang/websocket package currently offers no way of specifying this argument:

elm-lang/websocket#20

Apparently the only way to specify websocket subprotocols in Elm right now is to write your websocket code in JS and communicate with ports. That means that pretty much the only worthwhile thing that I can add to this package right now is a way to build decodable subscription requests, but I can't really offer any way to send them and listen for responses from within Elm; the end user will need to figure out that part for themselves with ports :(

Actually there is one relatively popular transport that I may be able to provide an implementation for, which is the one based on Phoenix Channels used by the Absinthe package for Elixir. I'll have to do more research into that and if it ends up making sense I would probably make a separate package for that transport.

@3nigm4
Copy link
Author

3nigm4 commented Jul 10, 2018

Thanks for your research on this!

@spunkedy
Copy link

@jamesmacaulay any more thoughts on this? I've used the phoenix channels and JS. But have been wanting to learn elm and wasn't sure if it could replace some of the things I have been wanting to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants