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

Any plans to support SSE (the future)? #10

Open
thojanssens opened this issue Mar 25, 2022 · 4 comments
Open

Any plans to support SSE (the future)? #10

thojanssens opened this issue Mar 25, 2022 · 4 comments

Comments

@thojanssens
Copy link

https://github.com/enisdenjo/graphql-sse/blob/master/PROTOCOL.md

https://www.the-guild.dev/blog/graphql-over-sse

@sax
Copy link
Collaborator

sax commented Mar 25, 2022

I think that SSE would need to be handled entirely differently from the way this library works, because SSE does not use UPGRADE requests to open websockets.

My quick read on this is that an absinthe SSE library could be a separate cowboy dispatcher. I see that there are some examples of how to implement SSE in cowboy, and a custom dispatcher can be registered.

In any case, I think that it would be a different library.

@thojanssens
Copy link
Author

Would you know why the example code you referred to https://hexdocs.pm/phoenix/Phoenix.Endpoint.Cowboy2Adapter.html#module-custom-dispatch-options is not to be found in this lib https://github.com/mustafaturan/sse/blob/9edc7bc2397fb618861f15edb0a9ffd9ff8bb59e/README.md#phoenix-framework ?

How is it running without the dispatcher?

@sax
Copy link
Collaborator

sax commented Mar 25, 2022

It looks like that readme is written more around running plug directly in Cowboy, without Phoenix involved at all. I was assuming that since you were using absinthe_graphql_ws that you were using Phoenix, which is why I thought the custom dispatcher docs might be relevant.

@thojanssens
Copy link
Author

It seems that Absinthe.Plug uses SSE here:
https://github.com/absinthe-graphql/absinthe_plug/blob/v1.5.8/lib/absinthe/plug.ex#L359
Would you have any idea what this is about?

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

2 participants