andreas / ocaml-graphql-server

GraphQL servers in OCaml
MIT License
624 stars 60 forks source link

subscriptions #188

Closed DrYSG closed 4 years ago

DrYSG commented 4 years ago

I see in your documentation how the schema is defined for subscriptions, but what transport are you doing subscriptions over? WebSockets? If I wanted to hook your code up with ReWeb, where would I look to do this?

more specifically, when I look at examples/server.ml I see a cohttp_lwt server, but I don't see how it is doing websockets for subscriptions.

andreas commented 4 years ago

Subscriptions are exposed via websockets following the protocol described in apollographql/subscriptions-transport. I'm not sufficiently familiar with ReWeb to give advice about that, but you can see the websocket handler code here for graphql-cohttp.

andreas commented 4 years ago

Closing this for now... please re-open if you have further questions 😄